Cleaning up old container images

Haha okay, not for fast, but there kinda is one for clearing up space! :wink: I’m speaking of course of:

./launcher cleanup

Which clears out old images when your disk runs out of space. This is one thing that a) I’ve personally had to run several times, b) is not super obvious that it exists unless you know to look for it, and c) has come up, I don’t know…at least many dozens of times on Meta over the years.

Figured I’d mention as I honestly have no idea why the “cleanup” can’t just happen automatically, say once a month and/or every rebuild :smiley: Not sure why I’d ever want to just keep around all old containers forever as the default.

2 Likes

Nowadays we run this command interactively when your disk space has less than 5GB free.

5 Likes

Ah gotcha, yeah that makes it harder to miss! Still feels like it should be a background job so no one ever has to manually run it at all. (Unless I’m missing something and there’s sometimes good reason to keep around the old unused containers)

You can’t guess why someone might want to keep around old containers. I have whole hard drives from computers that I decommissioned a decade ago. I don’t want someone else deciding to delete them. :wink:

1 Like

Ha you’re right I only ask because I literally don’t know what those reasons would be :thinking: :upside_down_face:

Of course I understand keeping backups for actual data retention purposes. But old containers = different right? I’m not a Docker expert and this is probably a weak metaphor, but to me feels more like if I’m on macOS Catalina, but kept around copies of Mojave, High Sierra, Sierra, El Capitan, Yosemite, etc. etc.

Not doubting you that there are…reasons! to keep containers around, just have never run into them in years of Discourse use, so guessing 99% of folks like me with vanilla installs never need em. If there were an option to always auto-clean old ones I’d use it!

I mean, plugins break all the time during major updates, especially third-party plugins. It’s not dissimilar to major macOS releases preventing certain apps from running.

Ah, so you’re saying having old containers is useful in case something breaks and you need to roll back? In that case would it be just the immediately previous container, or would there ever be a need for a container from wayyyy back?

I know the macOS comparison isn’t perfect but my point is I’d never ~ go back~ to a very old OS, even if certain legacy apps only run on the latest. If someone gives me a concrete example of “here’s a case where I actually did end up needing one of my old Discourse containers from two years ago” I will go ahead and shut up :slight_smile: This is just something I’ve wondered about for a very long time tbh.

My analogy was not perfect. But there are reasons that someone might have docker images and containers that are not in use that they might not want deleted because they run them only sometimes and don’t want to rebuild them the next time they need it.

2 Likes