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
demandé il y a un an1083 vues
1 réponse
1
Réponse acceptée

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
répondu il y a un an
profile picture
EXPERT
vérifié il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions