Docker container delete the file after commit mirror size unchanged?

I made a mirror
apline go dfc88444bfb8 24 hours ago 197.8 MB

  [Root @ mesos-master-01 ~] # docker run -it dfc88444bfb8 sh 
/ #
/ # Apk del go
(1/1) Purging go (1.5.4-r0)
Executing busybox-1.24.1-r7.trigger
OK: 22 MiB in 18 packages
/ # Du -sh
23.4M

As above, the operation in the container which removed the go package, the remaining container / size is 23.4M, but the implementation of docker commit
After that, this mirror is actually 1 latest 4442148f9f01 16 minutes ago 197.9 MB size has not changed? why?

  [Root @ mesos-master-01 ~] # docker history 4442148f9f01 
IMAGE CREATED CREATED BY SIZE COMMENT
4442148f9f01 3 hours ago sh 46.76 kB
Dfc88444bfb8 27 hours ago sh 193 MB
D7a513a663c1 6 weeks ago / bin / sh -c # (nop) ADD file: 033ab063740d9ff4dc 4.794 MB

I have deleted the container in the go installation package, actually there dfc88444bfb8 27 hours ago sh 193 MB this layer, strange

I also do the same operation through Dockerfile ,

  FROM alpine: 3.3 

RUN apk update --no-cache \
&& apk add go --no-cache \
&& apk del go

build out of the mirror even only 3 latest 92260938955c 3 hours ago 5.562 MB , depressed, and seek God advice 2016-05-20 add comment share it

  • Weibo
  • QZONE
  • Micro letter

Did not find the relevant results

    Invited:

    Xds2000 Digital Technology

    We agreed from:


    You do the operation inside the container, every step is a layer, you see you posted the docker history results to know.

    Heads up! This alert needs your attention, but it's not super important.