Docker Engine 29 reference · Volumes, Networks and Disk Usage
docker volume Command (Docker CLI)
Create, list, inspect and remove named volumes, the Docker-managed storage that outlives containers.
Docker Engine 29
Syntax
docker volume create|ls|inspect|rm|prune [OPTIONS] [VOLUME]
Parameters
| Parameter | Description |
|---|---|
create NAME |
Create a named volume. |
ls --filter |
List volumes. |
rm NAME |
Remove a volume (it must not be in use). |
prune |
Remove unused volumes: deletes data. |
Examples
docker volume create rc-ref-vol > /dev/null
docker run --rm -v rc-ref-vol:/data alpine:3.24 sh -c 'echo kept > /data/f'
docker run --rm -v rc-ref-vol:/data alpine:3.24 cat /data/f
docker volume rm rc-ref-vol
Output
kept rc-ref-vol
Run this on your computer — see “Get Started” for setup.
docker volume create --label team=demo rc-ref-vol2 > /dev/null
docker volume ls --filter label=team=demo --format '{{.Name}} ({{.Driver}})'
docker volume rm rc-ref-vol2 > /dev/null
Output
rc-ref-vol2 (local)
Run this on your computer — see “Get Started” for setup.
Related
docker network· Create and manage networks; containers on the same user-defined network reach each other by name.- Volumes: Keeping Data · tutorial