I am totally new to Google Cloud. I am trying to push a Docker image on Google Cloud Registry.
I have performed following steps :
- Installed Google Cloud SDK.
- Downloaded a JSON key file for my IM account
-
Set authentication using following command:
google-cloud-sdk/bin/gcloud auth activate-service-account --key-file <path_to_json_file>
-
Executed below command for login:
docker login -u _json_key --password-stdin https://asia.gcr.io < path_to_json_file
Now, when I am trying to push my image on my registry, with following command :
docker login -u _json_key --password-stdin https://asia.gcr.io <path_to_json_file>
I am getting an error on my SDK shell :
token exchange failed : Access denied.
Am I missing something ?
Best Answer
Did you check the official guide on how to push/pull?
Why are you trying to login? weren't you trying to push the image?
for example, if you are trying to push a nginx, the commands will be something like this:
Keep in mind that you will need to put your project ID, and the zone you want (being asia.gcr in our case i guess)