running df -h I get:
overlay 79G 70G 5.8G 93% /var/lib/docker/overlay2/a7bcb73019b20505a640593453aee3578647e027ccf90a607ad1806a9b25edd4/merged
Any idea how I can check why it takes so much space?
running df -h I get:
overlay 79G 70G 5.8G 93% /var/lib/docker/overlay2/a7bcb73019b20505a640593453aee3578647e027ccf90a607ad1806a9b25edd4/merged
Any idea how I can check why it takes so much space?
2
Answers
An overlay filesystem, like a bind mount, doesn’t use any disk space itself. What’s reported is the disk space of the underlying filesystem. In this case, if you run
df /var/lib/docker
you’ll see the same disk space allocated to that underlying filesystem, and you can review what is used on that mount.If the issue is docker, then
docker system prune
would be a first step. If that doesn’t help and you see significant usage from the /var/lib/docker folder you want to clean, see this answer for additional suggestions.I come a bit late, but this question is a recurring one, and I think this is lacking a diagnose step.
As @bmitch says, first check the size of
/var/lib/docker
.If docker is the problem, then run:
docker system df
. An example of output:With that, you can cleary see what is taking space, and clean selectively.
In some cases (mine), the build cache is the problem. You can safely delete it with
docker builder prune
. The usual options forprune
can apply (--all
,--filter
).For images, volumes, use the classical
prune
commands.