I want to run a k8s_objects Bazel rule from a Google Cloud Build step, which deploys new configurations to my cluster. Hence I need a Docker image with
- bazel (obviously for running bazel targets)
- kubectl (for applying new configuration to my cluster)
- gcloud (for authenticating to my Google Kubernetes Engine cluster)
installed. Currently I have this huge docker image which is 1GB in size and probably cluttered with stuff I don't need. Therefore my build times skyrocket to 10 minutes and more.
This is how my cloudbuild.yaml
looks like:
steps:
- name: eu.gcr.io/cents-ideas/slim-bazel-kubectl
entrypoint: /bin/sh
args:
- -c
- |
gcloud container clusters get-credentials cents-ideas --zone europe-west3-a --project cents-ideas
COPY failed: stat /var/lib/docker/tmp/docker-builder613695822/gcloud.pub.gpg: no such file or directory
– Florian LudewigCOPY
instruction in theDockerfile
copies the files insrc
todest
folder. You must be either missing thegcloud.pub.gpg
file or building the Dockerfile from the wrong directory. – sllopis