Skip to content
Latchkey

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

Terminal
podman rmi ghcr.io/owner/app:old
podman rmi -f 9c1b6dd
podman rmi $(podman images --filter dangling=true -q)
podman rmi -a   # remove all images

Options

FlagWhat it does
-f, --forceRemove even if containers reference the image
-a, --allRemove all images
-i, --ignoreIgnore 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.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →