GCR使用CLI检索无标记图像

时间:2017-10-05 13:03:45

标签: gcloud google-container-registry gcloud-cli

我知道您可以执行以下操作来检索特定图像的标记列表:

  

gcloud容器图片列表--repository = gcr.io / myproject

但我想知道我是否也可以使用gcloud CLI来检索没有标签的图像。

无标记图片显示在Google云端控制台网络界面中。

解决方案

  

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

2 个答案:

答案 0 :(得分:2)

list-tags会更好地满足您的需求。具体来说,如果您想查看所有图像的信息(包括未标记的图像):

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

如果你想打印未标记图像的摘要:

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

答案 1 :(得分:1)

我认为你要找的是list-tags子命令:

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