I just pushed a 2.8GB Docker image to the AWS container repository ECR. However, the Management Console gives the size of the image as 1.2GB. Why is that? I assume ECR comes with some automated compression, right?
2 Answers
There are two sizes reported for Docker images: compressed size and actual size on disk. The compressed file is what is sent over the network, so that is what image registries like ECR report, since it is how much bandwidth will be used to download the image.

- 3,430
- 1
- 13
- 17
-
2Is it possible to see the compressed size of the Docker image on my local machine? – Joe Mar 28 '20 at 18:54
The compression support is from docker itself. From the AWS documentation:
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 Docker Client Image Compression
The compressed image size is available on the repository. To see the compressed size locally, you can check remote repo image manifest to aggregate the layers size or use docker save
as described in the link below.