Cannot pull golang image in CloudBuild

1.3k Views Asked by At

I've created a simple go server and am following documentation to deploy the server on GCE. But I am getting the following error on my build. What am I missing? I've also tried using a specific version number (i.e. "1.16"), but still fails with a similar error message.

Starting Step #0
Step #0: Pulling image: mirror.gcr.io/library/golang
Step #0: Using default tag: latest
Step #0: Error response from daemon: manifest for mirror.gcr.io/library/golang:latest not found: manifest unknown: Failed to fetch "latest" from request "/v2/library/golang/manifests/latest".
...
Step #0: Error response from daemon: manifest for mirror.gcr.io/library/golang:latest not found: manifest unknown: Failed to fetch "latest" from request "/v2/library/golang/manifests/latest".
ERROR: failed to pull because we ran out of retries.
ERROR
ERROR: build step 0 "mirror.gcr.io/library/golang" failed: error pulling build step 0 "mirror.gcr.io/library/golang": generic::unknown: retry budget exhausted (10 attempts): step exited with non-zero status: 1
1

There are 1 best solutions below

3
On BEST ANSWER

For some reason the golang image isn't available at the moment via this registry. It could be an intermittent issue ‍♂️

$ docker pull mirror.gcr.io/library/golang
Using default tag: latest
Error response from daemon: manifest for mirror.gcr.io/library/golang:latest not found: manifest unknown: Failed to fetch "latest" from request "/v2/library/golang/manifests/latest".

// But weirdly this works
gcloud container images list --repository=mirror.gcr.io/library
// And this
docker pull mirror.gcr.io/library/alpine

So I would swap that line with the Golang Docker Hub image in your yaml file.

## Where it says:
- name: 'mirror.gcr.io/library/golang'
## Change to
- name: 'registry.hub.docker.com/library/golang'