0

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
Bak
  • 3
  • 3

1 Answers1

3

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'
Christian
  • 1,676
  • 13
  • 19
  • Thanks a ton for the alternative solution! Is `registry.hub.docker.com/library/golang` good replacement to be used in production? – Bak Apr 23 '21 at 20:44
  • I would think so, it's the Docker official image for go. Also, this image only builds the go binary. it's not the one that actually runs it on the server. – Christian Apr 24 '21 at 08:18
  • Note that if you are using this in a CI system, you will need a docker hub login (like a site or CI robot license) to prevent rate limits. – Danny Staple Dec 14 '22 at 12:08