dotcloud/docker — pull request #594 by vieux (2013-05-13 13:21:56+00:00)
Title: Add sizes in images and containers

Fixes #22

$>docker images -a

REPOSITORY TAG ID CREATED SIZE
busybox latest e9aa60c60128 7 weeks ago 6.51 MB (virtual 0 B)
vieux minecraft_server 6d4b7a164cc4 14 minutes ago 12.0 kB (virtual 659.55 MB)
base ubuntu-12.10 b750fe79269d 7 weeks ago 24.1 kB (virtual 171.75 MB)
dhrp/mongodb-sshd latest 59fe4e85bea3 6 weeks ago 3.364 GB (virtual 171.77 MB)
712e29ecc84c 14 minutes ago 2.27 MB (virtual 657.28 MB)
27cf78414709 7 weeks ago 171.75 MB (virtual 0 B)
93407101859d 17 minutes ago 35.40 MB (virtual 171.77 MB)
534f8b6157c4 17 minutes ago 56.7 kB (virtual 207.17 MB)
5569fed43e24 15 minutes ago 355.28 MB (virtual 302.00 MB)
d1d24098d412 17 minutes ago 92.12 MB (virtual 207.23 MB)
c2aa9bb4cd55 14 minutes ago 12.0 kB (virtual 659.54 MB)
0037757cab2b 17 minutes ago 2.65 MB (virtual 299.35 MB)

The size is computed in StoreImage (called while import or pull) and also in graph.Get for previously downloaded images.
The size of the parent is calculated every time in PS (it's very fast)

$>docker ps -a

ID IMAGE COMMAND CREATED STATUS PORTS SIZE
2a151609665e c2aa9bb4cd55 Exit 127 15 minutes ago 16.0 kB
322a8f6c6b4e 712e29ecc84c Exit 127 15 minutes ago 16.0 kB
b85c456df6c1 5569fed43e24 /bin/sh -c wget http Exit 0 15 minutes ago 2.27 MB
6f869614e4f9 0037757cab2b /bin/sh -c apt-get i Exit 0 18 minutes ago 355.28 MB
7f443142467e d1d24098d412 /bin/sh -c echo orac Exit 0 18 minutes ago 2.65 MB
647f7b708bcf 534f8b6157c4 /bin/sh -c apt-get u Exit 0 18 minutes ago 92.12 MB
306a574de7be 93407101859d /bin/sh -c apt-add-r Exit 0 19 minutes ago 56.7 kB
8c0a903a4b78 base:ubuntu-12.10 /bin/sh -c apt-get i Exit 0 20 minutes ago 35.39 MB

The size if calculated each time.