如何列出 public 亚马逊 ecr 存储库中可用的图像?

how to list images available in a public amazon ecr repo?

我想使用 aws cli 列出此处可用的图像:https://gallery.ecr.aws/lambda/nodejs

当我尝试以下命令时:

aws ecr-public describe-image-tags --repository-name lambda/nodejs

我收到这个错误:

User: arn:aws:sts::<my-session> is not authorized to perform: \
ecr-public:DescribeImageTags on resource: arn:aws:ecr-public::<my-account>:repository/lambda/nodejs

如何指定 aws public 存储库,而不是我自己的存储库?

api docs 提到一个 --registry-id 选项,以提供帐户 ID,或者如果留空 "..假定默认 public 注册表"。 =32=],但我的帐户信息似乎仍在插入。

问: 有人可以提供一个命令的工作示例,列出 Image 标签中的每个标签(或第一个分页)标签 Amazon ECR Public Gallery?

中的回购面板

实际上 AWS CLI 支持您创建的 Public Repositories,它们与您的账户相关联。就像我创建了一个名为 randomname 的存储库,我能够在其中列出图像。

$ aws ecr-public describe-images --repository-name randomname
{
    "imageDetails": [...]
}

Amazon ECR public registries

You can use your public registry to manage public image repositories consisting of Docker and Open Container Initiative (OCI) images. Each AWS account is provided with a default public and private Amazon ECR registry

更具体地说,您在 AWS Console

中看到的这一部分

在撰写本文时,这只能通过访问 ECR Public 画廊找到。对于您未被明确授予 API 访问权限的存储库,无法以编程方式获取 ECR Public 中的标签列表。这是相关的路线图项目 https://github.com/aws/containers-roadmap/issues/1262