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
asked a year ago1028 views
1 Answer
1
Accepted Answer

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
answered a year ago
profile picture
EXPERT
reviewed a year 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