Automatic cleanup of dangling docker images induced by updated egg containers
Discussed in https://github.com/pelican-dev/panel/discussions/54
Originally posted by DerLev April 13, 2024 I have had some issues in the past with dangling docker images filling up my storage on my wings host. An automatic task for cleaning up those dangling images would be nice. A current workaround is to set a cron job, which works fine but if this was to be included in the daemon itself or just as a simple note in the docs it would greatly help new users setting things up
Would it run docker image rm <image id> -f or rather docker image prune -f ?
I did add a wings endpoint that returns container usage data and allows pruning of images. (https://github.com/pelican-dev/wings/pull/6)
This isn't exposed in the node admin area yet, but it can be in the future. I'll also look into removing an image if it's no longer used after a server is deleted that can be enabled/disabled.
prune will remove images that are not being used. If a server is removed any dangling images would be removed by a prune.
In my opinion it's better to have the least impact than to prune all images just because one image is no longer in use.
prune could be ran every minute and I doubt it would have problems.
You could also clear your DNS cache every time you make a DNS query, but why would you?