as you can see I tagged my most recent image to belong to google cloud registry:
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
gcr.io/chess-king-council/council-kings latest e82b2f44af48 4 hours ago 1.05GB
<none> <none> 63a6c4d89d29 4 hours ago 1.05GB
<none> <none> b4637ec645fa 4 hours ago 1.05GB
<none> <none> 466bb4fd8026 4 hours ago 332MB
ubuntu 20.04 4e2eef94cd6b 2 weeks ago 73.9MB
ubuntu latest 4e2eef94cd6b 2 weeks ago 73.9MB
python 3.8.2 4f7cd4269fa9 4 months ago 934MB
node 13.12.0-alpine 483343d6c5f5 5 months ago 114MB
when I run the command:
docker push gcr.io/chess-king-council/council-kings
It gives the message:
unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication
I followed the steps at the link it gave to authenticate as a Docker credential helper, but nothing changed. Also, I am logged in as the owner of the project. Why won't google cloud let me push this Docker image? Am I missing something obvious?
This error can happen when the SDK is missing from the PATH and not necessarily a permissions issue. Check that in your ~/.bash_profile you have the location to the SDK in the $PATH as mentioned here on step #5.
example:
export PATH="/usr/local/yourfolder/google-cloud-sdk/latest/google-cloud-sdk/bin:$PATH"