Hello,
I just want to share a tad of experience I gathered today with this issue, which might hopefully help some people here to understand what might be going on.
We used a docker server for continuously deploying new software commits to a testing environment. After some time I found that around 25-30 GB where blocked in a place in the file system where I had no explanation what resource allocated the space (this is how I found out about this post).
Therefore I checked the system with du -shc /var/lib/docker/overlay2/*/diff
as dpatekar suggested (see his answer from September 2018)
Our next step after discovering this issue was docker system df
which showed that the most space taken by docker was in images with a value of 91% Reclaimable
We did some additional research and found out that our “docker image prune” or “docker container prune” did not work because we were having issues with dangling images (quick resource here for the difference between unused and dangling images: https://stackoverflow.com/a/45143234 ).
Therefore we used docker system prune -a
which cleared up 25 GB of space.
Edit: Using this command has been fine for our test server, but you might not want to use it in production (see the response below the stackoverflow answer I linked, it also provides an argument for a better approach to clear dangling images).
Therefore, if you are having issues on a production server: Please read the documentation before you use this and make sure you won’t delete elements you need: https://docs.docker.com/engine/reference/commandline/system_prune/
I hope this helps.
Cheers