Docker volume prune not working. test-volume is deleted.


  1. Home
    1. Docker volume prune not working To get the original behavior you can use docker volume prune --filter all=1 . docker volume rm $(docker volume ls -qf dangling=true) will do the job for named and unused ones. test-volume is deleted. When running docker volume prune, it deletes no volumes. The answer is always Total reclaimed space: 0B. Actual behavior it deletes all local volumes even on running containers (literally docker deleted all volumes) To free up disk space and optimize your Docker environment, you can use the docker volume prune command to remove these unused volumes: docker volume prune This command will remove all volumes that are not currently used by any containers. Or combine both steps: docker volume rm $(docker volume ls -q) Use the --all flag to prune both unused anonymous and named volumes. docker volume create test; docker volume prune--> test-volume is not deleted; Expected behavior. If there is more than one filter, then pass multiple flags (e. I don’t know if it is in the documentation, but I have noticed a minute ago that volumes created as bind mounts would not be deleted either. With Docker v24, docker volume prune will remove only unused anonymous local volumes. You can use the following commands to manage volume cleanup: docker volume prune: Remove all unused volumes; docker volume ls -f dangling=true: List all dangling (unused) volumes; docker volume rm <volume-name>: Remove a specific volume Apparently docker version 23 no longer deletes anonymous volumes (like your volume seems to be) when running docker volume prune. You can use the following commands to manage volume cleanup: docker volume prune: Remove all unused volumes; docker volume ls -f dangling=true: List all dangling (unused) volumes; docker volume rm <volume-name>: Remove a specific volume. g. Apparently docker version 23 no longer deletes anonymous volumes (like your volume seems to be) when running docker volume prune. Since the update to docker 23 unused volumes will not be deleted anymore with docker volume prune nor docker system prune --volumes. docker volume prune should only delete all local volumes not used by at least one container. Reproduce. The filtering flag (--filter) format is of "key=value". , --filter "foo=bar" --filter "bif=baz") The currently supported filters are: Volumes referenced by any running or not running container would not be removed by docker volume prune. docker version Over time, you may accumulate unused volumes that are taking up disk space. When I delete th Use docker volume ls -q to list volumes then docker volume rm to remove. Actually, "docker volume prune -f" forces volume removal without a prompt. vean gtzl rxof opjdqg ivuvjk pxhosx bgssl lnxm hmwz okzcl