From 70071ac0ff0a3fdb7aea443ff3af4539669d4d46 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Fri, 25 Oct 2024 10:44:40 -0700 Subject: [PATCH] authenticate docker host --- .trampolinerc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.trampolinerc b/.trampolinerc index 5fc22531..18e2baee 100644 --- a/.trampolinerc +++ b/.trampolinerc @@ -49,4 +49,19 @@ if [[ -z "${TRAMPOLINE_BUILD_FILE:-}" ]]; then fi # Secret Manager secrets. +TRAMPOLINE_HOST=$(echo "${TRAMPOLINE_IMAGE}" | cut -d/ -f1) +if [[ ! "${TRAMPOLINE_HOST}" =~ "gcr.io" ]] +then + echo "TRAMPOLINE_HOST: ${TRAMPOLINE_HOST}" + echo "HOME: ${HOME}" + echo "${HOME}":/home + docker run \ + --entrypoint=gcloud \ + --env HOME=:/home \ + --volume="${HOME}":/home \ + "gcr.io/google.com/cloudsdktool/cloud-sdk" \ + auth configure-docker "${TRAMPOLINE_HOST}" + echo "docker config:" + cat "${HOME}/.docker/config.json" +fi source ${PROJECT_ROOT}/.kokoro/populate-secrets.sh