docker system prune

Remove unused Docker data

high risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
Safer / dry-run alternatives
docker system dfCheck usage first
docker image pruneDangling images only
docker container pruneStopped containers only
What it does

Cleans up disk space used by Docker. See the flags and examples below, and run `man docker` for the full reference.

Common flags
FlagMeaning
-aRemove all unused images⚠ Forces re-pulls.
--volumes --volumesAlso prune volumes⚠ Deletes data in unused volumes.
-fDo not ask
Examples
docker system dfSee what uses space · explain & risk-check →
docker system pruneRemove dangling data · explain & risk-check →
Related
docker docker volume
Open the full explainer →More in Docker & Containers

Reference text is hand-written and may be incomplete — check man docker for your version. Test destructive commands on a non-production system first.