Skip to content

Commit 07aff58

Browse files
author
LU_ALL_mldevops
committed
ci: correct addition of docker user
1 parent 38aebba commit 07aff58

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

docker/Dockerfile.cuda12

+7-8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ RUN apt-get update && apt-get install -y \
1717
RUN apt-get update && apt-get install -y \
1818
python3 \
1919
python3-pip \
20+
python3.10-venv \
2021
&& rm -rf /var/lib/apt/lists/*
2122

2223
ARG GIT_VERSION=latest
@@ -25,20 +26,18 @@ ARG DOCKER_GID=1001
2526
ARG DOCKER_UID=12065
2627

2728
# Create a user with a specific UID and GID.
28-
RUN addgroup -g ${DOCKER_GID} docker && \
29-
adduser -D -u ${DOCKER_UID} -G docker docker_user
29+
RUN addgroup --gid ${DOCKER_GID} docker && \
30+
adduser --uid ${DOCKER_UID} --gid ${DOCKER_GID} --disabled-password --shell /bin/bash --gecos "Docker" docker_user
31+
32+
# Install in the virtual environment as the docker user.
33+
USER docker_user
34+
WORKDIR /home/docker_user
3035

3136
# Create a virtual environment for the application dependencies.
3237
ENV VIRTUAL_ENV=/home/docker_user/venv
3338
RUN python3 -m venv $VIRTUAL_ENV
3439
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
3540

36-
RUN chown -R docker_user:docker /home/docker_user
37-
38-
# Install in the virtual environment as the docker user.
39-
USER docker_user
40-
WORKDIR /home/docker_user
41-
4241
RUN if [ "$GIT_VERSION" != "latest" ]; then \
4342
git clone -b v${GIT_VERSION} --depth 1 https://github.com/mbari-org/sdcat.git; \
4443
else \

0 commit comments

Comments
 (0)