linux - Why the virtual size still the same after delete a file from container with rm? -


i know more docker. i'm beginner, new , linux. english not perfect therefore copied terminal output. had image 516mb virtual size. started bash in container , use wget download 26mb data this. after downloading create image container's changes commit. after virtual size 542.5mb. correct. after commit started again bash, , deleted file. when committed changes image virtual size 542.8mb.

this size not decreased, instead increased. tell me reason?

local images:

[fedora_user@fedora-vm ~]$ docker images repository             tag                 image id            created             virtual size tester/mytestfedora   latest              c0ca83567bdd        4 seconds ago       516 mb fedora                 latest              834629358fe2        3 months ago        241.3 mb 

using smallest 1 , downloading file:

[fedora_user@fedora-vm ~]$ docker run -i -t tester/mytestfedora /bin/bash bash-4.3# su dockeres [dockeres@05ef6e284e32 /]$ cd /home/dockeres/downloads/     [dockeres@05ef6e284e32 downloads]$ wget https://dl.dropboxusercontent.com/u/827503/0_temp/riverbed.zip --2015-03-31 19:24:47--  https://dl.dropboxusercontent.com/u/827503/0_temp/riverbed.zip resolving dl.dropboxusercontent.com (dl.dropboxusercontent.com)... 54.243.97.104, 54.243.80.193, 50.16.185.28, ... connecting dl.dropboxusercontent.com (dl.dropboxusercontent.com)|54.243.97.104|:443... connected. http request sent, awaiting response... 200 ok length: 26177252 (25m) [application/zip] saving to: 'riverbed.zip' riverbed.zip                      100%[==============================================================>]  24.96m  3.66mb/s   in 14s     2015-03-31 19:25:03 (1.78 mb/s) - 'riverbed.zip' saved [26177252/26177252] [dockeres@05ef6e284e32 downloads]$ exit bash-4.3# exit 

list active ones , create new image container's changes:

[fedora_user@fedora-vm ~]$ docker ps -all container id        image                         command             created             status                     ports               names 05ef6e284e32        tester/mytestfedora:latest   "/bin/bash"         2 minutes ago       exited (0) 6 seconds ago                       sick_einstein        [fedora_user@fedora-vm ~]$ docker commit 05ef6e284e32 tester/mytestfedora f122b12e94a32d477f2f2f18c5a5190a9ad5d349109933da65a0cfeff448c822 [fedora_user@fedora-vm ~]$ docker images repository             tag                 image id            created             virtual size tester/mytestfedora   latest              f122b12e94a3        5 seconds ago       542.5 mb fedora                 latest              834629358fe2        3 months ago        241.3 mb 

access again , remove downloaded file:

[fedora_user@fedora-vm ~]$ docker run -i -t tester/mytestfedora /bin/bash [dockeres@fb5ba36692f0 /]$ cd /home/dockeres/downloads/              [dockeres@fb5ba36692f0 downloads]$ rm -f riverbed.zip               [dockeres@fb5ba36692f0 downloads]$ ls [dockeres@fb5ba36692f0 downloads]$ exit bash-4.3# exit 

list active ones again , create new image container's changes:

[fedora_user@fedora-vm ~]$ docker ps -all container id        image                         command             created             status                     ports               names fb5ba36692f0        tester/mytestfedora:latest   "/bin/bash"         51 seconds ago      exited (0) 5 seconds ago                       goofy_yalow          [fedora_user@fedora-vm ~]$ docker commit fb5ba36692f0 tester/mytestfedora f744e248576d7fa434768a1e1d25625a9654020fe77e12306f304ff5d5ad3e3b [fedora_user@fedora-vm ~]$ docker images repository             tag                 image id            created             virtual size tester/mytestfedora   latest              f744e248576d        3 seconds ago       542.8 mb fedora                 latest              834629358fe2        3 months ago        241.3 mb 

thank in advance can provide.

ed

answer on comment, big comment.

single command

from ubuntu  run echo 'debconf debconf/frontend select noninteractive' | debconf-set-selections \  && apt-get -qq update \  && apt-get -qq -y install wget unzip \  && mkdir /usr/etc \  && cd /usr/etc \  && wget -nv -o /tmp/jboss.zip http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.final/jboss-as-7.1.1.final.zip \  && unzip /tmp/jboss.zip \  && apt-get clean \  && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 

smaller file:

$ docker build -t test1 . $ docker images | grep test1 test1 356 mb 

separate commands:

from ubuntu  run echo 'debconf debconf/frontend select noninteractive' | debconf-set-selections && apt-get -qq update && apt-get -qq -y install wget unzip run wget -nv -o /tmp/jboss.zip http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.final/jboss-as-7.1.1.final.zip run mkdir /usr/etc run cd /usr/etc && unzip /tmp/jboss.zip run apt-get clean run rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 

bigger image:

$ docker build -t test2 . $ docker images | grep test2 test2 510 mb 

Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -