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 年前檢視次數 1083 次
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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南