Replies: 2 comments 3 replies
-
So basically you would want to run a periodic timer that runs I have a few design problems with that kind of stuff in general, some of which is mentioned here #25864 But one general thing is that most podman commands are not race free when a prune is run in parallel, i.e. you would expect a podman run $remoteImage` to pull the image and create the container based on that. However if you run prune at the right time between podman run pulled the image but before it was able to create the actual container then prune will remove it as unused and then the creation fails randomly. And one other thing if we talk about system prune to prune containers, they get pruned when they are not running. That in turn means the important container that just exited might get pruned. And that then likely means its volumes would get pruned too which means data loss for sure. Maybe I am overthinking this but I really do not want to cause any data loss Then I wonder if this would need to be integrated into podman at all, we could have a small external script that uses something like |
Beta Was this translation helpful? Give feedback.
-
I mean the size threshold is certainly a podman specific config that could go into containers.conf. But for the time I don't see that practical because we are not a daemon so we would end up having a systemd timer defined and that declared the time. And of course one could add drop ins to change the time as needed.
I mean of course it can be possible to do that but it would need quite far reaching changes so I don't know if we would try to prune just as much. Of course there would be the question with what would you start to prune, containers, images, volumes, etc...?
This sounds like a good idea, podman image prune as a until filter however looking at podman images output the crreated time of an image is actually the time that we got from the registry. So if I pull a two weeks old an image right now created would be set to two weeks ago. So that is something that would need to be figured out before relying on such time filter.
Yeah, I tend to try to keep things out of podman as much as possible if they can already be done. Logic wise I don't disagree that having things part of podman proper is always nice as you can rely on them then to be present. Also if the goal is to only prune until the limit is reached then it is of course no longer simply done externally and would need some proper podman integration so that is certainly an argument for doing that. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Podman has nice commands around cleaning up containers/volumes/images that are "unused" meaning they aren't in current use by any containers.
I believe these things that are able to be cleaned up represent the
RECLAIMABLE
field in the output ofpodman systemd df
:What would be a killer feature is to be able to configure podman to use a certain amount of disk for container storage and when that threshold is met podman will periodically reclaim storage that it can.
Now what happens if we go over the threshold and there is no reclaimable storage available? I think we continue to operate over the threshold, but maybe print a warning for interactive commands or something.
Beta Was this translation helpful? Give feedback.
All reactions