feat: clear out docker builder cache once a day
There have been a number of tickets in the past - most recently #7061 - covering the fact that Dokku doesn't clean up disk utilization. The underlying issue is that Docker uses build cache that cannot be cleaned up in a targeted way - and usually doesn't even respect the builder gc settings in a way that makes sense. In fact, the computed disk space does not line up with actual disk utilization, causing it to be a mystery to anyone investigating the underlying problem. This change introduces a cron-based mechanism that cleans up disk once a day. Cleaning up more often would potentially cause issues during a build if for some reason the prune and an app deploy happened at the same time - its not clear if there is a lock on build cache usage - so cleaning up after hours once a day is a decent tradeoff. In the future, this setting may be modifiable, but it works well for now. Closes #7061
This commit is contained in:
4
docker/etc/cron.d/docker-builder-prune
Normal file
4
docker/etc/cron.d/docker-builder-prune
Normal file
@@ -0,0 +1,4 @@
|
||||
PATH=/usr/local/bin:/usr/bin:/bin
|
||||
SHELL=/bin/bash
|
||||
|
||||
5 4 * * * root /usr/local/bin/docker builder prune >>/var/log/dokku/builder-prune.log 2>&1
|
||||
Reference in New Issue
Block a user