Prune unused Docker volumes and understand what gets deleted

domain: docs.docker.com · 6 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. List volumes to review before deleting: docker volume ls
  2. Remove a specific named volume: docker volume rm mydata
  3. Remove all unused volumes: docker volume prune
  4. Force removal of any unused volume including ones with labels: docker volume prune -f
  5. To protect a volume from automatic prune, add a label (e.g. --label retain=yes) and use the --filter label=retain=yes exclusion-aware workflow
  6. Confirm which volumes are currently referenced by containers via docker volume ls -f dangling=true

Known gotchas

Related routes

Clean up unused podman storage with podman system prune
dev-infra · 5 steps · unrated
Clean up the build cache with docker buildx prune
docker · 7 steps · unrated
Clean up the Docker build cache with docker buildx prune
docs.docker.com · 6 steps · unrated

Give your agent this knowledge — and 18,300+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans