简体   繁体   English

如何列出公共亚马逊 ecr 回购中可用的图像?

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

i'd like use the aws cli to list images available here: https://gallery.ecr.aws/lambda/nodejs我想使用 aws cli 列出此处可用的图像: https://gallery.ecr.aws/lambda/nodejs

when i try the following command:当我尝试以下命令时:

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

i get this error:我收到此错误:

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

how do i specify the aws public repository, and not one of my own?我如何指定 aws 公共存储库,而不是我自己的存储库?

the api docs mention a --registry-id option, to supply an account ID, or if left blank "..the default public registry is assumed" , but it seems like my account info is still being inserted. api 文档提到了一个--registry-id选项,用于提供帐户 ID,或者如果留空则"..the default public registry is assumed" ,但似乎我的帐户信息仍在插入。

Q: can someone provide a working example of a command that lists each of (or the first pagination of) the tags in the Image tags panel of a repo in the Amazon ECR Public Gallery ?问:有人可以提供一个命令的工作示例,该命令在Amazon ECR 公共库的存储库的图像标签面板中列出每个标签(或第一个分页)吗?

At time of writing, this can only be found by visiting the ECR Public gallery.在撰写本文时,这只能通过访问 ECR 公共画廊找到。 There is no way to programmatically get a list of tags in ECR Public for a repository you haven't been explicitly granted API access to.无法以编程方式在 ECR Public 中为您未明确授予 API 访问权限的存储库获取标签列表。 Here's the relevant roadmap item https://github.com/aws/containers-roadmap/issues/1262这是相关的路线图项目https://github.com/aws/containers-roadmap/issues/1262

Actually AWS CLI supports the Public Repositories you created, which are linked with your account.实际上 AWS CLI 支持您创建的Public Repositories ,这些存储库与您的账户相关联。 Like I created a repository named randomname and I was able to list images under that.就像我创建了一个名为randomname的存储库,我能够在其下列出图像。

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

Amazon ECR public registries Amazon ECR 公共注册表

You can use your public registry to manage public image repositories consisting of Docker and Open Container Initiative (OCI) images.您可以使用公共注册表来管理由 Docker 和开放容器倡议 (OCI) 映像组成的公共映像存储库。 Each AWS account is provided with a default public and private Amazon ECR registry每个 AWS 账户都提供了一个默认的公共和私有 Amazon ECR 注册表

To be more specific this part you see in the AWS Console更具体地说,您在AWS Console中看到的这部分

在此处输入图像描述

在此处输入图像描述

For future reference, the tags listing API is now available in ECR Public: https://github.com/aws/containers-roadmap/issues/1262为了将来参考,列出 API 的标签现在可在 ECR 公开: https://github.com/aws/containers-roadmap/issues/1262

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM