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?

  • How to watch docker event with engine-api
  • Pushing to private docker registry fails
  • Security and isolation: Running non-root application in privileged-mode container
  • Docker-machine grant access to external network from inside docker hosts
  • NoHostAvailableException in DBeaver when connecting to remote Cassandra docker container
  • Editing Docker container FS using Atom/Sublime-Text?
  • A directory created in my web application running inside docker is missing
  • Connecting to RDS Mysql from docker container with Wordpress
  • docker image delete from private registry
  • The monit of docker?
  • docker machine (virtualbox vm) export container port to host machine fail
  • Unable to dockerize nginx and index.html page
  • 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.