# docker rmi Command Reference

> Reference for docker rmi in CI: remove one or more images with -f to reclaim disk on runners and clear dangling layers between builds.

Source: https://latchkey.dev/learn/command-reference/docker-rmi-command-reference  
Updated: 2026-06-26

Remove one or more images.

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
- `--no-prune` - do not delete untagged parent images

## Example

```shell
docker rmi myorg/app:old
docker rmi -f $(docker images -q --filter "dangling=true")
```

## 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.

## FAQ

### 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.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
