Skip to content

Get table report of docker images size in Aws ECR

Notifications You must be signed in to change notification settings

shladyr/python.dev-ops.docker-images-size-reporting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Docker Image Size Reporter

Overview

This Python script provides functionality to authenticate with AWS Elastic Container Registry (ECR),
check Read permissions, find all docker image repositories with tag "latest" and
report the sizes of Docker images in specified repositories.

Requirements, Prerequisites

  • Python 3
  • AWS Access Key and Secret Key with necessary permissions for ECR
  • boto3 library
  • tabulate library

Setup

  1. Clone the repository:

    git clone https://github.com/shladyr/docker_images_size_reporting.git

Execution, Usage

To run the script, execute the following command in the terminal:

python3 get_docker_images_size.py ${AWS_ACCESS_KEY_ID} ${AWS_SECRET_ACCESS_KEY}

Command-line Arguments

  • aws_access_key: AWS Access Key for authentication.
  • aws_secret_key: AWS Secret Key for authentication.

Example of OUTPUT

ecr_docker_size.png

References

Important Note

Beginning with Docker version 1.9, the Docker client compresses image layers
before pushing them to a V2 Docker registry. The output of the docker images command
shows the uncompressed image size, so it may return a larger image size than
the image sizes returned by DescribeImages.
See https://docs.aws.amazon.com/cli/latest/reference/ecr/describe-images.html

Diagram by pyfactor

Image_pyfactor.svg

Diagram by code2flow

Image_code2flow.png

Diagram by pyan3

Image_pyan.png

About

Get table report of docker images size in Aws ECR

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages