Skip to content

Latest commit

 

History

History
64 lines (41 loc) · 1.82 KB

File metadata and controls

64 lines (41 loc) · 1.82 KB

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