Lines Matching full:docker
20 # 1. Prepare the Docker image for the test
21 # 2. Run the Docker with appropriate flags to run the test
22 # 3. Upload the newly built Docker image
36 # TRAMPOLINE_IMAGE: The docker image to use.
41 # (true|false): Whether to upload the Docker image after the
43 # TRAMPOLINE_BUILD_FILE: The script to run in the docker container.
44 # TRAMPOLINE_WORKSPACE: The workspace path in the docker container.
151 gcloud auth configure-docker --quiet
231 # Configure the service account for pulling the docker image.
268 gcloud auth configure-docker --quiet
295 # ignore error on docker operations and test execution
298 log_yellow "Preparing Docker image."
299 # We only download the docker image in CI builds.
301 # Download the docker image specified by `TRAMPOLINE_IMAGE`
305 log_yellow "Start pulling the Docker image: ${TRAMPOLINE_IMAGE}."
306 if docker pull "${TRAMPOLINE_IMAGE}"; then
307 log_green "Finished pulling the Docker image: ${TRAMPOLINE_IMAGE}."
310 log_red "Failed pulling the Docker image: ${TRAMPOLINE_IMAGE}."
315 if docker images "${TRAMPOLINE_IMAGE}:latest" | grep "${TRAMPOLINE_IMAGE}"; then
323 # The default user for a Docker container has uid 0 (root). To avoid
324 # creating root-owned files in the build directory we tell docker to
330 # To allow docker in docker, we add the user to the docker group in
332 docker_gid=$(cut -d: -f3 < <(getent group docker))
336 # Build the Docker image from the source.
348 log_yellow "Start building the docker image."
350 echo "docker build" "${docker_build_flags[@]}" "${context_dir}"
353 # ON CI systems, we want to suppress docker build logs, only
356 if docker build "${docker_build_flags[@]}" "${context_dir}" \
362 log_green "Finished building the docker image."
365 log_red "Failed to build the Docker image, aborting."
371 if docker build "${docker_build_flags[@]}" "${context_dir}"; then
372 log_green "Finished building the docker image."
375 log_red "Failed to build the Docker image, aborting."
394 # Run in priviledged mode. We are not using docker for sandboxing or
398 # Run the docker script with the user id. Because the docker image gets to
400 # To allow docker in docker, we need to use docker gid on the host.
406 # Mount the project directory inside the Docker container.
415 # Allow docker in docker.
416 "--volume" "/var/run/docker.sock:/var/run/docker.sock"
418 # Mount the /tmp so that docker in docker can mount the files
449 echo docker run "${docker_flags[@]}" "${TRAMPOLINE_IMAGE}" "${commands[@]}"
451 docker run "${docker_flags[@]}" "${TRAMPOLINE_IMAGE}" "${commands[@]}"
453 log_yellow "Running the tests in a Docker container."
456 echo docker run "${docker_flags[@]}" "${TRAMPOLINE_IMAGE}"
458 docker run "${docker_flags[@]}" "${TRAMPOLINE_IMAGE}"
474 log_yellow "Uploading the Docker image."
475 if docker push "${TRAMPOLINE_IMAGE}"; then
476 log_green "Finished uploading the Docker image."
478 log_red "Failed uploading the Docker image."