Skip to content

Commit

Permalink
Do not make the user password an argument of the docker image
Browse files Browse the repository at this point in the history
Avoids a warning about insecure arguments
  • Loading branch information
mstimberg committed Sep 3, 2024
1 parent 5c6d814 commit 4ee0638
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ RUN python -m pip install --no-cache-dir --only-binary=:all: \
&& python -m pip install /tmp/dist/Brian2*_$(uname -m).whl brian2tools \
&& rm -rf /tmp/dist

# Create a non-root user
ARG USER="monty" \
GROUP="monty" \
PASSWORD="monty"
RUN groupadd ${GROUP} && \
useradd -ms /bin/bash -g ${GROUP} -G sudo ${USER} && \
echo "${USER}:${PASSWORD}" | chpasswd
# Create a non-root user (password same as username)
ARG USER="monty"
RUN groupadd ${USER} && \
useradd -ms /bin/bash -g ${USER} -G sudo ${USER} && \
echo "${USER}:${USER}" | chpasswd
ENV HOME="/home/${USER}"
RUN chown -R ${USER}:${USER} ${HOME}
USER ${USER}
Expand Down

0 comments on commit 4ee0638

Please sign in to comment.