Dokku’s /var/lib/docker/overlay2 too big?

One of the frustrating things about Dokku, is that pushes often report as succesful when they haven’t been. The most obvious example is when it didn’t trigger a build (see last post for more on that). But another one is if you’re out of disk space, and dokku fills up the /var/lib/overlay2 directory with a lot of images. Dokku’s own prune command is very conservative and doesn’t make much of an impact at all. And deleting anything from this directory is an absolute no no.

Freeing up space more effectively can be done with

docker system prune -a
Enter fullscreen mode
Exit fullscreen mode

This freed me up 21G of space. But it is going to fill up again pretty soon, so this is best set up as a cron job with the -f flag to stop it requesting for confirmation

Hit crontab -e and add the following

56 10 * * * docker system prune -af
Enter fullscreen mode
Exit fullscreen mode

And this should keep your /var/lib/docker/overlay2 folder in check


Discover more from Coursity

Subscribe to get the latest posts sent to your email.

Leave a Comment

Your email address will not be published. Required fields are marked *

Discover more from Coursity

Subscribe now to keep reading and get access to the full archive.

Continue reading

Scroll to Top
What about data privacy and security in saas applications ?. Real 2025 jupeb questions and answers| jupeb 2025/20 questions and answers /expo. Creating an effective work from home routine : productivity tips for remote work.