Docker Community Forums

Share and learn in the Docker community.

Difference size between Docker images size and container dizk size

docker

(Gugan K) #1

Actually wanted to know how the docker images size is calculated on “docker images” command. Since If I start the container from this image, the disk usage is around 600MB. But I don’t know why the image size shows around 800MB on docker images command view.

Docker images command output :
REPOSITORY TAG IMAGE ID CREATED SIZE
test_image latest 0c4e9c381181 5 minutes ago 823MB

Container Disk Usage - that started from “test_image”:
[root@6a131058e592 /]# du -sh *
12K anaconda-post.log
0 bin
4.0K boot
0 dev
12M etc
24K home
0 lib
0 lib64
0 media
0 mnt
38M opt
du: cannot access ‘proc/267/task/267/fd/4’: No such file or directory
du: cannot access ‘proc/267/task/267/fdinfo/4’: No such file or directory
du: cannot access ‘proc/267/fd/4’: No such file or directory
du: cannot access ‘proc/267/fdinfo/4’: No such file or directory
0 proc
32K root
24K run
0 sbin
0 srv
0 sys
16K tmp
527M usr
27M var
[root@6a131058e592 /]# exit
exit
[root@devbuild ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6a131058e592 test_image “/usr/bin/supervisord” 6 minutes ago Up 6 minutes 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp test2
[root@devbuild ~]#