ECR镜像与镜像layers

0

【以下的问题经过翻译处理】 我想了解镜像中使用的每个层的大小。我将使用这些信息来计算这些层的存储成本。此外,镜像的层可以用来揭示不同的生命周期策略。我希望能够在不下载所有层的情况下获取这些信息。 是否有一种 ECR API 可以返回所有层以及层的大小信息,而无需遍历它们?

profile picture
EXPERT
asked 5 months ago28 views
1 Answer
0

【以下的回答经过翻译处理】 我们可以使用AWS CLI命令来查找ECR镜像中所有层的大小,而不必下载这些层,命令如下:

aws ecr batch-get-image --repository-name <repo-name> --image-ids imageDigest-<image-digest' --region <region>

要查找镜像摘要,请使用以下ECR CLI命令:

aws ecr list-images --repository-name <repo-name> --region <region>

还可以使用以下命令来实现此目的: docker buildx imagetools inspect --raw $IMAGE_NAME:$IMAGE_TAG 安装指南:https://docs.docker.com/build/install-buildx/ 命令文档:https://docs.docker.com/engine/reference/commandline/buildx_imagetools_inspect/

profile picture
EXPERT
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions