Skip to content

Commit

Permalink
Fix GCR authentication for base images
Browse files Browse the repository at this point in the history
The overwriting of `$HOME` during cloud build execution will cause that
we loose the pre-setup authentication with GCR. To fix the behavior we
now manually add a call to `gcloud auth configure-docker`.

Signed-off-by: Sascha Grunert <mail@saschagrunert.de>
  • Loading branch information
saschagrunert committed Jan 22, 2021
1 parent 4d30c63 commit 97a8b16
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
7 changes: 5 additions & 2 deletions images/build/debian-base/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ options:
machineType: 'N1_HIGHCPU_8'
steps:
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20201130-750d12f'
entrypoint: make
entrypoint: bash
dir: ./images/build/debian-base
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
Expand All @@ -18,7 +18,10 @@ steps:
- CONFIG=$_CONFIG
- HOME=/root # for docker buildx
args:
- all-push
- -c
- |
gcloud auth configure-docker && \
make all-push
substitutions:
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
Expand Down
7 changes: 5 additions & 2 deletions images/build/debian-hyperkube-base/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ options:
machineType: 'N1_HIGHCPU_8'
steps:
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20200824-5d057db'
entrypoint: make
entrypoint: bash
dir: ./images/build/debian-hyperkube-base
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
- REGISTRY=gcr.io/$PROJECT_ID
- IMAGE=gcr.io/$PROJECT_ID/debian-hyperkube-base
- HOME=/root # for docker buildx
args:
- all-push
- -c
- |
gcloud auth configure-docker && \
make all-push
tags:
- 'debian-hyperkube-base'
7 changes: 5 additions & 2 deletions images/build/debian-iptables/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ options:
machineType: 'N1_HIGHCPU_8'
steps:
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20201130-750d12f'
entrypoint: make
entrypoint: bash
dir: ./images/build/debian-iptables
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
Expand All @@ -19,7 +19,10 @@ steps:
- IPTABLES_VERSION=$_IPTABLES_VERSION
- HOME=/root # for docker buildx
args:
- all-push
- -c
- |
gcloud auth configure-docker && \
make all-push
substitutions:
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
Expand Down

0 comments on commit 97a8b16

Please sign in to comment.