Docker image size

I pull a Docker image of about 0.5 GB in size on the Docker Hub. After pulling it on my Centos machine the size of the image became 1.6 GB. Pushing the image with a new name show 2 GB on the Docker hub.
How can I obtain an image with the same size on the Docker hub?

  • Trying to use webpack-dev-server in container, getting errors that are not there otherwise
  • Can you efficiently change a lower level Docker container, without rebuilding all the apps that rely on it?
  • Set up docker remote execution on windows
  • Phusion Passenger and Docker-Compose Issue with Permissions
  • docker-compose can not retrieve variables from SOME.env files
  • What are the benefits of using DEB for installation with Dockerfile
  • udevadm does not show all attributes inside a docker container
  • Building fiware/cygnus docker from source code - issue with the last step (8)
  • accessing host's virtual machine from docker container
  • WSO2 : how to download products in a Dockerfile?
  • Prometheus cAdvisor docker monitoring
  • How to remote debug python code in a Docker Container with VS Code
  • One Solution collect form web for “Docker image size”

    A similar issue was reported in issue 14204, for docker 1.7.0 on Ubuntu.
    (And by default, CentOS might not have the latest version of docker, so the first step would be to upgrade if possible)

    The questions to check were:

    1. How did you install docker?
    2. Can you provide the list the steps to reproduce the issue?
    3. Can you post the output from sudo du -sh /var/lib/docker/*
    4. You are using devicemapper as a storage driver, can you try using aufs?

    For the last point, as described in this article, check /etc/default/docker

    # Use DOCKER_OPTS to modify the daemon startup options.
    DOCKER_OPTS="--storage-driver=devicemapper"
    

    As the OP Dragomir Adrian confirms in the comments, it is a docker version issue: upgrading to 1.9.1 helps.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.