Docker image sizes and push compression

647 views
Skip to first unread message

Emile Bosch

unread,
Dec 21, 2013, 10:35:50 AM12/21/13
to docke...@googlegroups.com
Hi guys,

I’ve got a question regarding images sizes.

First of all whenever an image is being created using a vagrantfile, the size of the image seems to be a magnitude bigger then when exporting
and import the same container. I.e. a base rails image with nginx/mysql/unicorn is about 700 MB but the file as an image shows about 1.2 GB.

However when i export and import the image, after i exported it, its around 700MB. When i export and gzip the container its about 220MB. But when i push
it uploads the actual 700 something MB.

How come there is so much wasted bytes being used? And more important, is this on the roadmap, or should
i fork and send a PR?

Thanks!

- Emile

Emile Bosch

unread,
Dec 21, 2013, 10:42:57 AM12/21/13
to docke...@googlegroups.com
There is a typo in my previous e-mail. I mean docker file not vagrant file. Here are some more stats.

I’ve included the docker file below:

Here some stats

- 1.02 GB from docker file build
- After docker export and import = 700MB (zipped about 220MB) ID=$(docker run -d startup /bin/bash) && (docker export $ID | gzip -c > startup.tgz)
- When pushing uploading it uploads about 700MB

 ```
from ubuntu:12.04

run apt-get update
run apt-get -y install mysql-server libmysqlclient-dev
run apt-get -y install curl git vim imagemagick
run apt-get -y install libreadline-dev build-essential libssl-dev
          
run echo "deb http://archive.ubuntu.com/ubuntu precise universe" >> /etc/apt/sources.list

run apt-get -y install python-software-properties
run apt-get -y install 

run add-apt-repository ppa:chris-lea/node.js

run apt-get update
run apt-get -y install supervisor nodejs openssh-server nginx 

run echo 'export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"' > .bashrc

env PATH $HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH
run git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

run CONFIGURE_OPTS="--with-readline-dir=/usr/include/readline" rbenv install 2.0.0-p195
run rbenv global 2.0.0-p195

run apt-get clean

run gem install bundler --no-rdoc --no-ri && rbenv rehash

run mkdir /var/run/sshd
```

--
You received this message because you are subscribed to the Google Groups "docker-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to docker-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Jérôme Petazzoni

unread,
Jan 2, 2014, 6:35:14 AM1/2/14
to Emile Bosch, docker-dev
Hi,

Can you indicate which commands let you think that it's using 1.2 GB?
(I don't understand which file you're talking about when you say "the file as an image shows about 1.2 GB").

Thank you!
Reply all
Reply to author
Forward
0 new messages