docker-volume
manage Docker persistent data volumes
TLDR
List all volumes
$ docker volume ls
Create a named volume$ docker volume create [name]
Inspect a volume's details$ docker volume inspect [volume]
Remove a specific volume$ docker volume rm [volume]
Remove all unused volumes$ docker volume prune
Remove all unused volumes without confirmation$ docker volume prune --force
Create a volume with NFS driver options$ docker volume create --driver local --opt type=nfs --opt o=addr=[host],rw --opt device=:[path] [name]
List volumes with filter$ docker volume ls --filter dangling=true
SYNOPSIS
docker volume command [options]
DESCRIPTION
docker volume manages Docker volumes. Volumes persist data independently of containers and are the preferred mechanism for persisting data generated by containers. Unlike bind mounts, volumes are managed by Docker and work across all platforms.
SUBCOMMANDS
ls
List volumes. Supports --filter and --format options.create
Create a volume. Optionally specify --driver and --opt.inspect
Display detailed information on one or more volumes.rm
Remove one or more volumes. Fails if volume is in use.prune
Remove all unused local volumes.
INSTALL
sudo apt install docker-cli
sudo dnf install docker-cli
sudo pacman -S docker
sudo apk add docker-cli
sudo zypper install docker
brew install docker
nix profile install nixpkgs#docker
SEE ALSO
docker-run(1), docker-inspect(1), docker-container(1), docker-compose(1)
