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.
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.
Frequently asked questions
podman rmi: Remove Images and Reclaim Space?
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.
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.