2025-03-14 21:59:59 -06:00
|
|
|
# docker volume
|
|
|
|
|
|
|
|
|
|
> Manage Docker volumes.
|
|
|
|
|
> More information: <https://docs.docker.com/reference/cli/docker/volume/>.
|
|
|
|
|
|
|
|
|
|
- Create a volume:
|
|
|
|
|
|
|
|
|
|
`docker volume create {{volume_name}}`
|
|
|
|
|
|
|
|
|
|
- Create a volume with a specific label:
|
|
|
|
|
|
|
|
|
|
`docker volume create --label {{label}} {{volume_name}}`
|
|
|
|
|
|
|
|
|
|
- Create a `tmpfs` volume a size of 100 MiB and an uid of 1000:
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`docker volume create {{[-o|--opt]}} {{type}}={{tmpfs}} {{[-o|--opt]}} {{device}}={{tmpfs}} {{[-o|--opt]}} {{o}}={{size=100m,uid=1000}} {{volume_name}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- List all volumes:
|
|
|
|
|
|
|
|
|
|
`docker volume ls`
|
|
|
|
|
|
|
|
|
|
- Remove a volume:
|
|
|
|
|
|
|
|
|
|
`docker volume rm {{volume_name}}`
|
|
|
|
|
|
|
|
|
|
- Display information about a volume:
|
|
|
|
|
|
|
|
|
|
`docker volume inspect {{volume_name}}`
|
|
|
|
|
|
|
|
|
|
- Remove all unused local volumes:
|
|
|
|
|
|
|
|
|
|
`docker volume prune`
|
|
|
|
|
|
|
|
|
|
- Display help for a subcommand:
|
|
|
|
|
|
|
|
|
|
`docker volume {{subcommand}} --help`
|