]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commit
setup_container_runtime: Fix image pruning 2583/head
authorDavid Galloway <david.galloway@ibm.com>
Fri, 15 May 2026 18:35:05 +0000 (14:35 -0400)
committerDavid Galloway <david.galloway@ibm.com>
Fri, 15 May 2026 18:39:11 +0000 (14:39 -0400)
commitc7f4482a6ad00a6a748fe2a0a3449ca37050c9cb
treec55b951b00a585a62b74ebbb2bdcb02ff386459d
parent9f0a812398285dc307c60ef114b552c7918f02a8
setup_container_runtime: Fix image pruning

`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: https://github.com/ceph/ceph-build/pull/2583
Signed-off-by: David Galloway <david.galloway@ibm.com>
scripts/setup_container_runtime.sh