ECR Images and layers

0

I'm looking to find out the size of all the layers that they are using. I will use this information to calculate the storage costs for these layers. In addition, they Forecast Different Lifecycle Policies. I would like to get this information without pulling down all the layers. We are looking to query. Is there an ECR API that can return all the layers and the size of the layers without walking them?

AWS
已提问 1 年前1087 查看次数
1 回答
1
已接受的回答

We can use the AWS CLI to find the size of all the layers in an ECR image without pulling down the layers using below ECR CLI command:

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

To find out image digest run use below ECR CLI command:

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

We can also use the command below to achive that. docker buildx imagetools inspect --raw $IMAGE_NAME:$IMAGE_TAG Installation guide : https://docs.docker.com/build/install-buildx/ Command documentation : https://docs.docker.com/engine/reference/commandline/buildx_imagetools_inspect/

AWS
已回答 1 年前
profile picture
专家
已审核 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容