File tree Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -166,19 +166,12 @@ RUN sudo systemctl enable redis-server.service
166
166
# kbuilder uid on the default Kokoro image
167
167
ARG UID=1000
168
168
ARG USERNAME=kbuilder
169
- ARG DOCKER_GID=999
170
169
171
170
# Add a new user to the container image.
172
- # To allow access to the docker socket on the host, we use the docker
173
- # group on the host.
171
+ # This is needed for ssh and sudo access.
174
172
175
- # First make sure the group exists. Ignore a failure in case
176
- # there is already a group with that id.
177
- RUN groupadd -g ${DOCKER_GID} "host-docker" | true
178
-
179
- # Add a new user with the caller's uid and the docker goup id on the
180
- # host.
181
- RUN useradd -d /h -u ${UID} -g ${DOCKER_GID} ${USERNAME}
173
+ # Add a new user with the caller's uid and the username.
174
+ RUN useradd -d /h -u ${UID} ${USERNAME}
182
175
183
176
# Allow nopasswd sudo
184
177
RUN echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
Original file line number Diff line number Diff line change @@ -240,9 +240,7 @@ if [[ "${TRAMPOLINE_DOCKERFILE:-none}" != "none" ]]; then
240
240
" -f" " ${TRAMPOLINE_DOCKERFILE} "
241
241
" -t" " ${TRAMPOLINE_IMAGE} "
242
242
" --build-arg" " UID=${user_uid} "
243
- " --build-arg" " GID=${user_gid} "
244
243
" --build-arg" " USERNAME=${user_name} "
245
- " --build-arg" " DOCKER_GID=${docker_gid} "
246
244
)
247
245
if [[ " ${has_cache} " == " true" ]]; then
248
246
docker_build_flags+=(" --cache-from" " ${TRAMPOLINE_IMAGE} " )
@@ -280,6 +278,8 @@ docker_flags=(
280
278
281
279
# Run the docker script with the user id. Because the docker image gets to
282
280
# write in ${PWD} you typically want this to be your user id.
281
+ # To allow docker in docker, we need to use docker gid on the host.
282
+ # Now we passing the wrong one in order to see the build report failure.
283
283
" --user" " ${user_uid} :${user_gid} "
284
284
285
285
# Pass down the USER.
You can’t perform that action at this time.
0 commit comments