Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6fdea00

Browse files
author
Takashi Matsuo
committed
remove unnecessary build args
1 parent eeb37e3 commit 6fdea00

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

.kokoro/docker/Dockerfile

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,19 +166,12 @@ RUN sudo systemctl enable redis-server.service
166166
# kbuilder uid on the default Kokoro image
167167
ARG UID=1000
168168
ARG USERNAME=kbuilder
169-
ARG DOCKER_GID=999
170169

171170
# 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.
174172

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}
182175

183176
# Allow nopasswd sudo
184177
RUN echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

.kokoro/trampoline_v2.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,7 @@ if [[ "${TRAMPOLINE_DOCKERFILE:-none}" != "none" ]]; then
240240
"-f" "${TRAMPOLINE_DOCKERFILE}"
241241
"-t" "${TRAMPOLINE_IMAGE}"
242242
"--build-arg" "UID=${user_uid}"
243-
"--build-arg" "GID=${user_gid}"
244243
"--build-arg" "USERNAME=${user_name}"
245-
"--build-arg" "DOCKER_GID=${docker_gid}"
246244
)
247245
if [[ "${has_cache}" == "true" ]]; then
248246
docker_build_flags+=("--cache-from" "${TRAMPOLINE_IMAGE}")
@@ -280,6 +278,8 @@ docker_flags=(
280278

281279
# Run the docker script with the user id. Because the docker image gets to
282280
# 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.
283283
"--user" "${user_uid}:${user_gid}"
284284

285285
# Pass down the USER.

0 commit comments

Comments
 (0)