panel icon indicating copy to clipboard operation
panel copied to clipboard

Automatic cleanup of dangling docker images induced by updated egg containers

Open lancepioch opened this issue 1 year ago • 6 comments

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

lancepioch avatar May 17 '24 19:05 lancepioch

Would it run docker image rm <image id> -f or rather docker image prune -f ?

rmartinoscar avatar May 17 '24 19:05 rmartinoscar

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.

iamkubi avatar May 17 '24 22:05 iamkubi

prune will remove images that are not being used. If a server is removed any dangling images would be removed by a prune.

parkervcp avatar May 18 '24 21:05 parkervcp

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.

iamkubi avatar May 18 '24 22:05 iamkubi

prune could be ran every minute and I doubt it would have problems.

parkervcp avatar May 18 '24 22:05 parkervcp

You could also clear your DNS cache every time you make a DNS query, but why would you?

iamkubi avatar May 18 '24 22:05 iamkubi