Docker Community Forums

Share and learn in the Docker community.

Docker is taking all disk space

Hi everyone,

I got an issue with my docker.
It eats all my disk space until is full an block my server Debian 9.

It happenned few days after when we changed host.

I already tried all purge commands and a complete reinstallation of docker but nothing worked.

The only way I have to free space is to restart my server…

I already du all my folders (system and docker) there is no big files anywhere and the most “wtf” is that even without a running docker it takes space Oo Only way for now is to stop docker service OR change to aufs storage but as it will be be depreciate very soon I’d like a way to make it functionnal with overlay2.

Is there a god here who can help me please ?

EDIT: Even with different storage like aufs problem persists

It’s a kernel problem with devicemapper, which affects the RedHat family of OS (RedHat, Fedora, CentOS, and Amazon Linux). Deleted containers don’t free up mapped disk space. This means that on the affected OSs you’ll slowly run out of space as you start and restart containers.

The Docker project is aware of this, and the kernel is supposedly fixed in upstream (

A work-around of sorts is to give Docker its own volume to write to (“When Docker eats up you disk space”). This doesn’t actually stop it from eating space, just from taking down other parts of your system after it does.

My solution was to uninstall docker, then delete all its files, then reinstall:

sudo yum remove docker
sudo rm -rf /var/lib/docker
sudo yum install docker
This got my space back, but it’s not much different than just launching a replacement instance. I have not found a nicer solution.

Hi lewish95

Unfornatunatly reinstall+deletes files didn’t work, I even recreated from scratch my container.
I don’t use devicemapper as driver but overlay2 or aufs.