1

I know you can do the following to retrieve a list of tags of a specific image:

gcloud container images list --repository=gcr.io/myproject

But I was wondering whether I can also use the gcloud CLI to retrieve the images without a tag.

The tag-less images are shown in the Google cloud console web interface.

Solution

gcloud container images list-tags gcr.io/myproject/repo --filter='-tags:*'

TheWolfNL
  • 1,263
  • 1
  • 13
  • 29

2 Answers2

3

list-tags would be better for your needs. Specifically, if you want to see information on all images (including untagged ones):

gcloud container images list-tags gcr.io/project-id/repository --format=json

And if you want to print the digests of images which are untagged:

gcloud container images list-tags gcr.io/project-id/repository --filter='-tags:*' --format='get(digest)' --limit=$BIG_NUMBER

jsand
  • 595
  • 4
  • 8
  • The first command doesn't give me the untagged images, but the `--filter='-tags:*'` part did the trick! – TheWolfNL Oct 10 '17 at 11:13
1

I think what you are looking for is list-tags sub-command:

gcloud container images list-tags --repository=gcr.io/myproject/myrepo
The Archetypal Paul
  • 41,321
  • 20
  • 104
  • 134
Nick Y.
  • 256
  • 2
  • 4