Docker Cheat Sheet/Prune unused images

Remove all unused images.

Section: Images

Prune unused images

bash
bash
docker image prune -a
Explanation

More aggressive than pruning only dangling images.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Images
Prune dangling images
Remove dangling images.
OpenIn sheetbashsame section
Remove an image
Delete a local image.
OpenIn sheetbashsame section
Force remove an image
Force-remove a local image.
OpenIn sheetbashsame section
Pull an image
Download an image from a registry.
OpenIn sheetbashsame section
Push an image
Upload an image to a registry.
OpenIn sheetbashsame section
List images
List local images.
OpenIn sheetbashsame section