How to use Google Container registry with docker CLI

The Google Container Registry documentation explains that in order to pull and click images on gcr.io, you need the docker prefix pushand pullc gcloud preview.

gcloud preview docker push gcr.io/<gcr_namespace>/<docker-image>
gcloud preview docker pull gcr.io/<gcr_namespace>/<docker-image>

Is there a way to use the Google Container registry with the CLI dockerdirectly, without a prefix gcloud preview?

+4
source share
2 answers

You can use the following commands:

gcloud preview docker -a

to update the local docker configuration with gcr.io credentials.

And then use the usual dockerCLI commands to click and drag images:

docker build -t gcr.io/<gcr_namespace>/<docker-image> .
docker push gcr.io/<gcr_namespace>/<docker-image>

Or for existing images:

docker tag <docker-image> gcr.io/<gcr_namespace>/<docker-image>
docker push gcr.io/<gcr_namespace>/<docker-image>
docker pull gcr.io/<gcr_namespace>/<docker-image>

CLI , , gcloud preview docker -a .

+4

gcr.io :

gcloud preview docker -a
docker build -t gcr.io/<project_id>/<docker-image> <directory>
push gcr.io/<project_id>/<docker-image>
+1

All Articles