upload docker image to google cloud platform: https://grc.io/v2/: Service Unavailable

Viewed 1075

I'am trying to upload a locally created docker image (graalvm, docker desktop on Mac) to gcp (with a real project id).

I see the following error:

% docker push grc.io/<project>/facility
The push refers to repository [grc.io/<project>/facility]

Get https://grc.io/v2/: Service Unavailable

I set up gcloud auth:

gcloud auth configure-docker

and my .docker/config.json looks like this

{
  "experimental" : "disabled",
  "credHelpers" : {
    "gcr.io" : "gcloud",
    "us.gcr.io" : "gcloud",
    "eu.gcr.io" : "gcloud"
  },
  "auths" : {

  },
  "stackOrchestrator" : "swarm"
}

Running

echo "https://gcr.io" | docker-credential-gcloud get

provides a token.

What is the problem?

-- Update --

When I run this (works)

gcloud container images list --repository=gcr.io/<project-id> --log-http

it is talking to https://gcr.io/v2/token?... and the docker-credential-gcloud above is talking to https://oauth2.googleapis.com/token.

4 Answers

Here is an alternative solution:

gcloud builds submit --tag gcr.io/<project-name>/<app-name>

Looks like you have a typo. It should be gcr.io not grc.io

You are supposed to replace the <project> in

docker push grc.io/<project>/facility

with your project id.

If you are not sure how to get the project id, you can get list of all the projects with their IDs via cli.

gcloud projects list

After spending more time on this I found out that gcp has container registries and artifact registries (beta).

Since I don't get it running with the container registry I created a new test project and an artifact registry.

Setup is the same apart from the registry address.

After locally running

gcloud auth application-default login
gcloud beta auth configure-docker us-east1-docker.pkg.dev

my ~/.docker/config.json has the following credHelper entry

  "credHelpers": {
    "us-east1-docker.pkg.dev": "gcloud"
  },

Now I can tag & push

docker tag a01478beacf9 us-east1-docker.pkg.dev/test-2/facility/name
docker push us-east1-docker.pkg.dev/test-2/facility/name

The tag has 4 parts:

HOST-NAME              /PROJECT-ID/REPOSITORY/IMAGE
us-east1-docker.pkg.dev/test-2    /facility  /name

and it just works. :)

Related