Preview a Docker prune before it deletes
Updated 29 November 2026
Docker's prune commands have no dry-run option. docker system prune tells you which kinds of things it will remove, such as "all stopped containers", and asks y/N, but not which ones. dpad shows the list first.
Source: Docker's docker system prune reference lists --all, --filter, --force and --volumes, and no dry-run flag.
How it works
- In
dp, press X. The preview opens on the kind that matches your tab: images on Images, volumes on Volumes, networks on Networks, stopped containers anywhere else. - tab and shift+tab move between kinds. a widens images and volumes, as below.
- Read the list. Nothing is removed yet.
- Press y.
| Kind | The preview lists | With a | Matches |
|---|---|---|---|
| Containers | exited, created and dead containers | docker container prune | |
| Images | untagged images no container uses | also tagged images no container uses | docker image prune (--all) |
| Volumes | anonymous volumes no container mounts | also named volumes no container mounts | docker volume prune (--all) |
| Networks | user-defined networks no container uses | docker network prune | |
| Build cache | build cache records not in use | docker builder prune --all | |
| System | all of the above except volumes, with every unused image, tagged or not | docker system prune --all |
"No container" includes stopped ones, so an image or volume that a stopped container still uses stays. Sizes are shown for images and build cache. Image sizes include layers shared with other images, so they are not a promise of disk space freed.
A whole system prune
The last kind, system, is one shift+tab from stopped containers. It lists what docker system prune -a would remove: stopped containers, then the networks and images (tagged or not) that no remaining container uses, then unused build cache. An image that only a stopped container used is on the list, because that container goes first. Volumes are kept, as they are without --volumes.
The title counts each kind, for example prune system · 3 containers · 1 network · 12 images · 40 cache records · 2.1GB, and a TYPE column says what each row is. After y, the kinds are removed in that order.
Only what you saw
After y, dpad reads the list again. If it changed since the preview, you get the new preview and need another y. Otherwise it removes exactly the resources you saw, one request each and never forced, so anything that started being used in the meantime fails with Docker's error instead of disappearing. Each row then says removed, failed or unknown (interrupted, may have applied); select a failed row to read the error. esc during removal cancels the rest.
Build cache is the exception: Docker has no call to remove a single record, so it is pruned in one request, and the summary counts any records created after the preview that went too.
Without dpad
To get close with the Docker CLI alone, list before you prune:
$ docker ps -a --filter status=exited --filter status=created --filter status=dead $ docker images --filter dangling=true $ docker volume ls --filter dangling=true $ docker network ls --filter type=custom
These show candidates, but the prune that follows is a separate command and removes whatever matches at that moment.
Full reference: Prune.