2

I am totally new to Google Cloud. I am trying to push a Docker image on Google Cloud Registry. I have performed following steps :

  1. Installed Google Cloud SDK.
  2. Downloaded a JSON key file for my IM account
  3. Set authentication using following command:

    google-cloud-sdk/bin/gcloud auth activate-service-account --key-file <path_to_json_file>

  4. 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 ?

amonaco
  • 27
  • 2

1 Answers1

1

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:

$ gcloud auth configure-docker activate-service-account --key-file <path_to_json_file>

$ docker tag simple-nginx eu.gcr.io/PROJECT_ID/simple-nginx

$ docker push eu.gcr.io/PROJECT_ID/simple-nginx

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)