docker rmi deletes images from the local store, reclaiming the disk their layers occupy. In CI it is used to clear dangling images or to free space mid-pipeline on disk-constrained runners.
Common flags
-f, --force - remove even if referenced by a stopped container or multiple tags
Use docker rmi with docker images -q --filter dangling=true to reclaim untagged layers, or docker system prune for a broader sweep. "image is being used by running container" means a container still references it; stop and rm the container first or use -f.
Key takeaways
rmi removes images and reclaims their layer disk usage.
Combine with docker images -q --filter dangling=true to clear untagged layers.
A referencing container blocks removal unless you use -f.
Frequently asked questions
docker rmi Command Reference?
docker rmi deletes images from the local store, reclaiming the disk their layers occupy. In CI it is used to clear dangling images or to free space mid-pipeline on disk-constrained runners.
In CI?
Use docker rmi with docker images -q --filter dangling=true to reclaim untagged layers, or docker system prune for a broader sweep. "image is being used by running container" means a container still references it; stop and rm the container first or use -f.