首页 > 解决方案 > Google Cloud Container Registry 使用 gcloud 命令列出子目录中的图像

问题描述

如何在 Google Cloud Container Registry 的“子目录”中获取图像列表?

我在 GCP 上有这些图像:

gcr.io/project-id/website/api
gcr.io/project-id/website/api-builder
gcr.io/project-id/website/frontend
gcr.io/project-id/website/frontend-builder

但是当我发出命令时...

gcloud container images list

它只给我

NAME
gcr.io/project-id/website

我希望能够获取搜索查询的所有图像,project-id/website并获得上面的所有 4 张图像。

如果我发出这个命令:

gcloud container images list-tags gcr.io/project-id/website

我当然没有结果。

我搜索了谷歌并检查了帮助页面无济于事。

谢谢!

标签: dockergoogle-cloud-platformgclouddocker-registry

解决方案


回答我自己的问题。我回到 GCP 并在用户界面中看到了这个:

在此处输入图像描述

所以当我看到“存储库”标题时它点击了。图像在存储库中,可以嵌套。

所以我尝试了这个命令:

gcloud container images list --repository gcr.io/project-id/website

回来了

NAME
gcr.io/project-id/website/api
gcr.io/project-id/website/api-builder
gcr.io/project-id/website/frontend
gcr.io/project-id/website/frontend-builder

推荐阅读