Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker taking much more space than sum of containers, images and volumes

Tags:

docker

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 prunewhich doesn't help.

du -sh /var/lib/docker

enter image description here

docker system df

docker

du -sh /var/lib/docker/*

enter image description here

du -sh /var/lib/docker/containers/*

enter image description here

like image 799
Robycool Avatar asked Dec 17 '19 11:12

Robycool


Video Answer


1 Answers

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?

like image 150
Bora Karaca Avatar answered Sep 27 '22 21:09

Bora Karaca