Skip to content

Commit

Permalink
Add GID to docker user creation
Browse files Browse the repository at this point in the history
  • Loading branch information
j-rivero committed Aug 12, 2021
1 parent 079a093 commit ef59662
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jenkins-scripts/docker/lib/docker_generate_dockerfile.bash
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,9 @@ cat >> Dockerfile << DELIM_DOCKER_USER
# Create a user with passwordless sudo
ARG USERID
ARG USER
RUN adduser --uid \$USERID --gecos "Developer" --disabled-password \$USER
ARG GID
RUN groupadd -g "\$GID" "\$USER";
RUN adduser --uid \$USERID --gid \$GID --gecos "Developer" --disabled-password \$USER
RUN adduser \$USER sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
Expand Down
1 change: 1 addition & 0 deletions jenkins-scripts/docker/lib/docker_run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ USERID=$(id -u)
USER=$(whoami)

sudo docker build ${_DOCKER_BUILD_EXTRA_ARGS} \
--build-arg GID=$(id -g $USER) \
--build-arg USERID=$USERID \
--build-arg USER=$USER \
--tag ${DOCKER_TAG} .
Expand Down

0 comments on commit ef59662

Please sign in to comment.