Reputation: 1224
Docker running on Ubuntu is taking 18G of disk space (on a partition of 20G), causing server crashes. Commands below show that there is a serious mismatch between "official" image, container and volume sizes and the docker folder size.
What causes this and how can I cleanup ?
I already tried docker system prune
which doesn't help.
du -sh /var/lib/docker
docker system df
du -sh /var/lib/docker/*
du -sh /var/lib/docker/containers/*
Upvotes: 14
Views: 16541
Reputation: 511
I was having the same problem. I solved my problem by deleting log files
sudo sh -c "truncate -s 0 /var/lib/docker/containers/*/*-json.log"
Link: How to clear the logs properly for a Docker container?
Upvotes: 15
Reputation:
You have two containers that are eating your storage. Those containers must be running, because you said you already ran docker system prune
. Otherwise /var/lib/docker/containers
would be empty.
So check why are those two consuming so much. Probably they are logging too much to stdout.
Upvotes: 5
Reputation: 145
docker system prune
should clean up old unused layers, I have managed to get lots of disk space back several times with this. Hope it helps.
Upvotes: 1