For my current docker version (1.12.1 for both Client & Server) a way to delete all volumes is by using:
docker volume rm $(docker volume ls -q)
but the following is safer: (thanks Matt for your comment)
$(docker volume ls -qf dangling=true)
Also from version: 1.13.0 (2017-01-18) some commands were added:
$ docker system prune
$ docker container prune
$ docker image prune
$ docker volume prune
$ docker network prune
Changelog: Add new docker system
command with df
and prune
subcommands for system resource management, as well as docker {container,image,volume,network} prune
subcommands #26108 #27525 / #27525