← 返回命令列表

Linux command

docker-volume 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

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

说明

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.

FAQ

What is the docker-volume command used for?

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.

How do I run a basic docker-volume example?

Run `docker volume ls` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more docker-volume examples?

This page includes 8 examples for docker-volume, plus related commands for nearby Linux tasks.