Docker: How to Check Which Docker Container is Using the Space in Linux

root's picture

I had an issue a couple of days ago in which I had the /docker filesystem full and unable to pinpoint exactly which docker container is using it.
Fortunately docker comes with powerful utilities to help you out with this.
Follow what comes if curious.

How to check how docker is using the system space:

The following commands even if they are close they provide different output. the -v option will give you way more details
docker system df -v
docker system df

In this case, the problem was with a local volume so while the previous command can tell you which local volume is using the space, the following one will show you which docker container is using that local volume so you will know exactly what to cleanup.

How to check which container is using a local volume:

In this example, local volume name is 0518adc5fe115812b848411339cfb54df81471dcf75e59c9dcef512130bdf713.
docker ps -a --filter volume=0518adc5fe115812b848411339cfb54df81471dcf75e59c9dcef512130bdf713

There is also a video demo with what was briefly explained.

Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself! Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!

Or at least link back to this website.

Recent content

root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root