Managing Docker Disk Space Usage on CentOS Linux Server

Hello forum members,

I hope you are all doing well. I have a concern regarding our Docker setup on a CentOS Linux server, and I’m looking for some guidance on how to manage the disk space effectively.

Here’s the issue we are facing: Initially, our Docker installation didn’t consume much space, but as we began building images and performing other tasks, our available disk space has significantly decreased from 120GB to 96GB, and it’s continuing to decrease (currently at 44GB). I’m aware that our image size is 2.5GB, but I’m curious about what other factors contribute to this disk space usage and how we can address it.

I should note that we have already removed our dangling images to free up some space, but the issue persists. Any insights or recommendations on optimizing Docker’s disk space usage in this CentOS environment would be greatly appreciated. Thank you in advance for your help!

Check docker prune to remove unused objects.

For running containers you can also set the amount of logs to keep, sometimes only logs can be gigabytes.

Example docker run --log-opt max-size=100m --log-opt max-file=10

1 Like

Hi @bluepuma77, Thank for the reply. I will check the prune command and logs part.

Are there any other files/folders in inside docker folder on Linux that increases every time we build our image?