I am SSH'd into a GCE instance in Project A whose service account has Storage Admin access in Project B, where Image Foo is located. When I run docker build . from the command line of my GCE instance, I get the above error when docker tries to pull Image Foo from Project B. I have configured docker according to the instructions in the link, and authenticated using gcloud.
docker-credential-gcr is Google Container Registry's standalone, gcloud SDK-independent Docker credential helper. It allows for v18. 03+ Docker clients to easily make authenticated requests to GCR's repositories (gcr.io, eu.gcr.io, etc.).
I suspect it's one or two of two things:
First, check which account you're running under on the VM (gcloud auth list
). It's probably the VM's service account not your user account. This is the account that needs to be IAM'd to the bucket;
Second, ensure you've configured docker to access the account's credentials for GCR (if possible: gcloud auth configure-docker
).
Then, it should work.
I repro'd your error and applied these changes and it works (link)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With