Skip to content

Commit

Permalink
Use getent for conditional user creation
Browse files Browse the repository at this point in the history
  • Loading branch information
waxlamp committed Nov 11, 2024
1 parent ed00d1b commit ee7230e
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 --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 ee7230e

Please sign in to comment.