Docker image size increases when pulled from docker hub

Viewed 417

I did docker pull tiangolo/uwsgi-nginx-flask and this image size in docker hub is 345MB but when I pulled it to my local it increased to 963 MB.

So, Below are my questions:

  1. Will docker image size increases when is it being pulled?
  2. Is there any way to reduce or get the actual size as an image in the docker hub?
1 Answers

Dockerhub compresses each layer in the image and store it.

For example: https://hub.docker.com/_/node?tab=tags

See the COMPRESSED SIZE tag on each image and it says:

This size is calculated by summing the image's layers, of which are compressed.

Is there any way to reduce or get the actual size as an image in the docker hub?

If you want to work with the image or create containers from it then the image has to be uncompressed. Docker controls this behaviour IMHO.

Related