The docker version is 17.03.1-ce, and the storage driver is overlay2.
The size of the directory “/var/lib/docker/overlay2” is 30G per the following command,
# du -hs /var/lib/docker/overlay2/ 30G /var/lib/docker/overlay2/
But the size of the directory is 11G based on the following command. Why the size returned by this command is 11G, but it’s 30G per the above command, it’s really confusing. Can anyone please clarify it?
# du -hs /var/lib/docker/* 2.9G /var/lib/docker/containers 6.2M /var/lib/docker/image 188K /var/lib/docker/network 11G /var/lib/docker/overlay2 0 /var/lib/docker/plugins 0 /var/lib/docker/swarm 0 /var/lib/docker/tmp 0 /var/lib/docker/trust 152K /var/lib/docker/volumes
I tried to reclaim the unused disk space using command “docker system prune -a -f”, but basically the disk space usage keeps unchanged. What’s the correct way to reclaim the space?
The info returned by command “docker system df” is as below,
# docker system df TYPE TOTAL ACTIVE SIZE RECLAIMABLE Images 19 19 1.168 GB 121.7 MB (10%) Containers 144 101 8.404 GB 4.46 kB (0%) Local Volumes 101 101 1.2 kB 0 B (0%)