LinuxCommandLibrary

docker-volume

manage Docker persistent data volumes

TLDR

List all volumes
$ docker volume ls
copy
Create a named volume
$ docker volume create [name]
copy
Inspect a volume's details
$ docker volume inspect [volume]
copy
Remove a specific volume
$ docker volume rm [volume]
copy
Remove all unused volumes
$ docker volume prune
copy
Remove all unused volumes without confirmation
$ docker volume prune --force
copy
Create a volume with NFS driver options
$ docker volume create --driver local --opt type=nfs --opt o=addr=[host],rw --opt device=:[path] [name]
copy
List volumes with filter
$ docker volume ls --filter dangling=true
copy

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.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard