setup_container_runtime: Fix image pruning#2583
Open
djgalloway wants to merge 1 commit into
Open
Conversation
`podman system prune --force` can still exit 0 even if there are images still in use by external containers. e.g., ``` + podman system prune --force Deleted Images 63ce0076aa6cdd5544433330d81d0a116b3cfcace3d3ca7aabcf953d97ee819d 2234e3448b78b20836a83c3559ba45ec0d3713786c9ce8ccaadd0ae728b6c3b5 Total reclaimed space: 1.607GB real 0m1.948s user 0m0.536s sys 0m1.061s + podman image prune --filter=until=168h --all --force Error: 2 errors occurred: * image used by b0c2fcd16e3423046b704d626ee30f1e9d455efb844640aa83f61d0f2bf7b426: image is in use by a container: consider listing external containers and force-removing image * image used by fe06141e65c607edd79df847d793116c00b9749cea2bb5b1b247cfca1c72e9d9: image is in use by a container: consider listing external containers and force-removing image real 0m19.330s user 0m1.280s sys 0m10.139s Build step 'Execute shell' marked build as failure ``` Since this script is already pretty destructive, just add --external unconditionally. Fixes: #2583 Signed-off-by: David Galloway <david.galloway@ibm.com>
zmc
approved these changes
May 15, 2026
Member
zmc
left a comment
There was a problem hiding this comment.
Looks reasonable, but let's note that it will reduce the effectiveness of the build/image cache. I wonder if it could be useful to monitor podman's storage footprint on the builders to see trends over time.
I'd consider the podman behavior to be a bug, fwiw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
podman system prune --forcecan still exit 0 even if there are images still in use by external containers. e.g.,Since this script is already pretty destructive, just add --external unconditionally.