podman rmi: Remove Images and Reclaim Space
podman rmi removes images from local storage to reclaim disk space on the runner.
Runners fill up fast with build layers. podman rmi clears images you no longer need; pair it with --filter dangling to sweep untagged leftovers.
What it does
podman rmi (alias podman image rm) deletes one or more images from local storage. An image cannot be removed while a container uses it unless you force it; -f removes the image and untags it from any dependents.
Common usage
podman rmi ghcr.io/owner/app:old
podman rmi -f 9c1b6dd
podman rmi $(podman images --filter dangling=true -q)
podman rmi -a # remove all imagesOptions
| Flag | What it does |
|---|---|
| -f, --force | Remove even if containers reference the image |
| -a, --all | Remove all images |
| -i, --ignore | Ignore images that do not exist |
In CI
Sweep dangling images with podman rmi $(podman images --filter dangling=true -q) to recover space between steps, or use podman image prune for the same effect. Use -f only when you know no running container needs the image.
Common errors in CI
"Error: image used by ... : image is in use by a container" means a container references it; remove the container first or add -f. "Error: unable to delete ... (must force) - image is referred to in multiple repositories" means several tags point at it; rmi each tag or use -f. An rmi over an ID that has child images may report it is being used; remove dependents first.