Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3de9c7a

Browse filesBrowse files
author
Takashi Matsuo
committed
ignore failure when creating a group
1 parent 30cc436 commit 3de9c7a
Copy full SHA for 3de9c7a

File tree

Expand file treeCollapse file tree

1 file changed

+13
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-5
lines changed

‎.kokoro/docker/Dockerfile

Copy file name to clipboardExpand all lines: .kokoro/docker/Dockerfile
+13-5Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,19 @@ ARG GID=0
167167
ARG USERNAME=kbuilder
168168
ARG DOCKER_GID=999
169169

170-
# Allow access docker socker in the host.
171-
RUN groupadd -g ${DOCKER_GID} "host-docker"
172-
RUN groupadd -g ${GID} "${USERNAME}"
173-
RUN useradd -d /h -u ${UID} -g ${GID} ${USERNAME}
174-
RUN adduser "${USERNAME}" "host-docker"
170+
# Add a new user to the container image.
171+
# To allow access to the docker socket on the host, we use the docker
172+
# group on the host.
173+
174+
# First make sure the group exists. Ignore a failure in case
175+
# there is already a group with that id.
176+
RUN groupadd -g ${DOCKER_GID} "host-docker" | true
177+
178+
# Add a new user with the caller's uid and the docker goup id on the
179+
# host.
180+
RUN useradd -d /h -u ${UID} -g ${DOCKER_GID} ${USERNAME}
181+
182+
# Allow nopasswd sudo
175183
RUN echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
176184

177185
CMD ["python3.6"]

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.