space issue on docker devmapper and CentOS7

Docker

Docker Problem Overview


I am learning docker and I am using v1.11.0 I am trying to install hadoop but devmapper is complaining about free disk space?

devmapper: Thin Pool has 82984 free data blocks which is less than minimum required 163840 free data blocks. Create more free space in thin pool or use dm.min_free_space option to change behavior

I have deleted all my images but the problem persists:

[root@localhost hadoop_docker]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
debian              latest              47af6ca8a14a        3 weeks ago         125 MB
[root@localhost hadoop_docker]#

and this is my disk configuration:

[root@localhost ~]# lsblk
NAME                       MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                          8:0    0    8G  0 disk
├─sda1                       8:1    0  500M  0 part /boot
└─sda2                       8:2    0  7.5G  0 part
  ├─centos-root            253:0    0  6.7G  0 lvm  /
  └─centos-swap            253:1    0  820M  0 lvm  [SWAP]
sr0                         11:0    1 1024M  0 rom
loop0                        7:0    0  100G  0 loop
└─docker-253:0-844682-pool 253:2    0  100G  0 dm
loop1                        7:1    0    2G  0 loop
└─docker-253:0-844682-pool 253:2    0  100G  0 dm

QUESTION: How could I free up the disk space?

thank you

Docker Solutions


Solution 1 - Docker

Just run these three. No need to remove RUNNING containers.

  1. Cleanup exited processes:

     docker rm $(docker ps -q -f status=exited)
    
  2. Cleanup dangling volumes:

     docker volume rm $(docker volume ls -qf dangling=true)
    
  3. Cleanup dangling images:

     docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
    

Solution 2 - Docker

You can use:

docker system prune -a -f --volumes

where:

  • -a == removes all unused images
  • -f == force
  • --volumes == prune volumes.

see: https://docs.docker.com/engine/reference/commandline/system_prune/#description

as a side note, I had a lot of issues when I used devicemapper driver on my environment. I used to clean as I mentioned, but there were still other devicemapper issues. I strongly recommend moving to overlay2, it solved almost everything completely.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionmasberView Question on Stackoverflow
Solution 1 - DockerCokorda RakaView Answer on Stackoverflow
Solution 2 - DockerTidhar Klein OrbachView Answer on Stackoverflow