Some way to clean up / identify contents of /var/lib/docker/overlay

Hi,

Just joining to add something to this discussion. I had this similarly problem with my servers. I had like 10 apps running with two containers each. Even with all of their volumes and data, I should have only 30-35GB of used storage, but instead, I was disk full at 155GB.

What I did to solve this, besides the traditional docker system prune --all, was removing all docker logs files from my containers…

My containers are running mostly webservers and my access logs are printed on stdout. So they became huge after a couple months.

So, what I did was:

#to remove all log files
find /var/lib/docker/containers/ -type f -name “*.log” -delete

Then I executed a docker-compose down && docker-compose up -d in all my applications to have those log files created again.

104GB was freed by doing this.

Hope this helps someone.

Cheers,

Matheuscmpm

2 Likes