Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list the published container images in the Google Container Registry using gcloud or another CLI

Is there a gcloud API or other command line interface (CLI) to access the list of published container images in the private Google Container Registry? (That is the container registry inside a Google Cloud Platform project)

gcloud container does not seem to help:

$ gcloud container
Usage: gcloud container [optional flags] <group | command>
  group may be           clusters | operations
  command may be         get-server-config

Deploy and manage clusters of machines for running containers.

flags:
  --zone ZONE, -z ZONE   The compute zone (e.g. us-central1-a) for the cluster

global flags:
  Run `gcloud -h` for a description of flags available to all commands.

command groups:
  clusters               Deploy and teardown Google Container Engine clusters.
  operations             Get and list operations for Google Container Engine
                         clusters.

commands:
  get-server-config      Get Container Engine server config.

I also don't want to use gcloud docker to list images because this wants to connect to a particular docker daemon that I don't have. Unless there is a way to tell gcloud docker to connect to a remote public docker daemon that can read the private containers pushed to the registry through my project.

like image 474
4 revs, 2 users 76% Avatar asked Feb 08 '16 10:02

4 revs, 2 users 76%


People also ask

Where do you store container images in Google cloud?

[HOSTNAME] is the location where the image is hosted, and is one of four options: gcr.io , us.gcr.io , eu.gcr.io , or asia.gcr.io . [PROJECT-ID] is the Google Cloud console project ID. If your project ID has a colon in it ( : ) see Domain-scoped projects. [IMAGE] is the image's name in Container Registry.

Where can users find GCP preferred base container images?

Google maintains base images for building its own applications. These images are available to users at Google Cloud Marketplace.


1 Answers

We just released a new command to list the images in your repository! You can try it out with:

gcloud alpha container images list --repository=gcr.io/$MYREPOSITORY

If you want to see the specific tags for an image you can use:

gcloud alpha container images list-tags gcr.io/$MYREPOSITORY/$MYIMAGE
like image 73
dlorenc Avatar answered Oct 05 '22 04:10

dlorenc