rit-sse / sse-eos

🚢 SSE Technology Infrastructure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better Docker storage cleanup.

akath20 opened this issue · comments

After leaving the website to make any new database transactions (rit-sse/OneRepoToRuleThemAll#231) either a script or cron job needs to be created to periodically clear out large files created by old docker images/caches.

I'm curious if Docker itself has configuration where it will prune old images/caches based on some policy.

There are a few ways to approach this:

  • Write a cron job that does this
  • Have the CI run a cleanup command after a successful deploy
  • Setup alerting on eggs so that we get an email/text/Slack message/something when disk space reaches some threshold and run the command manually

Seeing that it took ~1 year for this to be an issue, totally something we could just do manually every now and then.

AFAIK docker doesn't have a way to prune older images based on some conditional. For me personally, I usually go in and remove some images if I haven't done so after a certain amount of time. You could always do a cron job for this, but it doesn't take a lot of time to go in every once in a while and docker system prune, or just docker container|image prune.

I think a cron job would suffice. It's not a big deal, but it may be neglected as we pass it off to tech heads and they forget vs. a cron job.

Makes sense. Always good to have automation where you can.

Whatever we choose, @akath20 you should make a note of this in the handbook.