Skip to content

Commit

Permalink
feat: create user and group with static UID/GID
Browse files Browse the repository at this point in the history
Closes #3
  • Loading branch information
virtualroot committed Aug 1, 2023
1 parent dba814a commit 795d5d0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ FROM $image

ARG username

RUN adduser -s /bin/false -D -h /$username $username
RUN addgroup --gid 12123 $username && \
adduser --uid 12123 -G $username -s /bin/false -D -h /$username $username

WORKDIR /$username
USER $username
3 changes: 2 additions & 1 deletion Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ FROM $image

ARG username

RUN adduser --shell /bin/false --home /$username --disabled-password $username
RUN addgroup --gid 12123 $username && \
adduser --uid 12123 --ingroup $username --shell /bin/false --home /$username --disabled-password $username

WORKDIR /$username
USER $username
3 changes: 2 additions & 1 deletion Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ FROM $image

ARG username

RUN adduser --shell /bin/false --home /$username --disabled-password $username
RUN addgroup --gid 12123 $username && \
adduser --uid 12123 --ingroup $username --shell /bin/false --home /$username --disabled-password $username

WORKDIR /$username
USER $username

0 comments on commit 795d5d0

Please sign in to comment.