Skip to content

Commit

Permalink
Force group and/or user deletion in user-specific build container if …
Browse files Browse the repository at this point in the history
…there is a clash
  • Loading branch information
fritzm committed Sep 7, 2023
1 parent 9aaf64f commit 88eb123
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions admin/tools/docker/build-user/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ ARG UID
ARG GROUP
ARG GID

RUN getent group $GID || groupadd --gid $GID $GROUP
RUN getent passwd $UID || useradd --uid $UID --gid $GROUP $USER
RUN OGROUP=$(getent group $GID | cut -d: -f1) && if [ "$OGROUP" != "" ]; then groupdel $OGROUP; fi
RUN groupadd --gid $GID $GROUP
RUN OUSER=$(getent passwd $UID | cut -d: -f1) && if [ "$OUSER" != "" ]; then userdel $OUSER; fi
RUN useradd --uid $UID --gid $GROUP $USER

USER $USER
WORKDIR /home/$USER

0 comments on commit 88eb123

Please sign in to comment.