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.
- Python 3
- AWS Access Key and Secret Key with necessary permissions for ECR
- boto3 library
- tabulate library
-
Clone the repository:
git clone https://github.com/shladyr/docker_images_size_reporting.git
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}
aws_access_key
: AWS Access Key for authentication.aws_secret_key
: AWS Secret Key for authentication.
- https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecr/client/describe_images.html
- https://boto3.amazonaws.com/v1/documentation/api/1.26.83/reference/services/ecr/client/describe_repositories.html
- https://pypi.org/project/tabulate/
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