docker volume rm: Remove Volumes & In-Use Errors
Delete a named volume and reclaim its disk.
docker volume rm removes one or more volumes. This page covers the in-use error and how it differs from docker volume prune.
What it does
docker volume rm deletes named volumes and their data. A volume cannot be removed while a container (even a stopped one) references it.
Common usage
Terminal
docker volume rm pgdata
docker volume rm $(docker volume ls -q --filter "dangling=true")Common errors in CI
"Error response from daemon: remove pgdata: volume is in use - [container-id]" means a container still references it - remove that container first (docker rm -f), then the volume. Removing a volume deletes its data irreversibly; do not run blanket volume removals on shared runners with persistent state you care about.
Related guides
docker volume prune: Remove Unused VolumesHow docker volume prune works: bulk-removing unused volumes, the -a flag, and reclaiming volume disk on CI ru…
docker volume ls: List Volumes & Find DanglingHow docker volume ls works: listing volumes, filtering dangling ones, formatting, and spotting volume disk bl…
docker rm: Remove Containers & Force CleanupHow docker rm works: removing stopped containers, force-removing running ones, removing volumes, and CI clean…
docker volume create: Create Named VolumesHow docker volume create works: creating named volumes for persistent data, drivers and labels, and using vol…