Skip to content

Commit

Permalink
Use getent to control conditional creation of user
Browse files Browse the repository at this point in the history
  • Loading branch information
waxlamp committed Nov 11, 2024
1 parent d7026cc commit 3eeeeb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dev/django.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ARG LOGIN=root
ARG GROUPID=0
ARG GROUPNAME=root
RUN getent group ${GROUPID} || addgroup --gid ${GROUPID} ${GROUPNAME}
RUN if [ "${USERID}" != 0 ]; then adduser --allow-bad-names --uid ${USERID} --gid ${GROUPID} --home /home/${LOGIN} $LOGIN; fi
RUN getent passwd ${USERID} || adduser --allow-bad-names --uid ${USERID} --gid ${GROUPID} --home /home/${LOGIN} $LOGIN

# Create the project folder and make the user its owner.
RUN mkdir -p /opt/django-project
Expand Down

0 comments on commit 3eeeeb9

Please sign in to comment.