DEV Community

Cover image for Dokku's /var/lib/docker/overlay2 too big?
cerico
cerico

Posted on

1

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

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

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (1)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay