docker volume prune: Remove Unused Volumes
Remove unused volumes to reclaim disk.
docker volume prune deletes volumes not used by any container. This page covers the scope of "unused" and the data-loss caution for CI.
What it does
docker volume prune removes anonymous volumes not referenced by a container (default), and with -a all unused volumes including named ones. This reclaims disk from orphaned volumes.
Common usage
Terminal
docker volume prune -f
docker volume prune -af # include named unused volumesCommon errors in CI
Without -f it prompts and stalls CI - pass -f. Pruning is irreversible: -af removes named volumes too, so on a persistent runner this can wipe a cache or database volume you meant to keep. Scope cleanup, or use labels and --filter "label!=keep" to protect specific volumes.
Related guides
docker volume rm: Remove Volumes & In-Use ErrorsHow docker volume rm works: deleting named volumes, the volume-in-use error, removing dangling volumes, and C…
docker volume ls: List Volumes & Find DanglingHow docker volume ls works: listing volumes, filtering dangling ones, formatting, and spotting volume disk bl…
docker system prune: Reclaim Disk in CIHow docker system prune works: removing stopped containers, unused networks, dangling images, and build cache…
Docker "no space left on device" - Causes and FixesWhy Docker builds fail with "no space left on device" in CI, and how to reclaim space, prune layers, and stop…