create_volume
Create a Docker volume to persist data beyond container lifecycles. Specify a name, driver, and options for bind-mounts or NFS shares.
Instructions
Create a volume managed by Docker.
Named volumes persist after their containers stop or are removed; use them for
databases, uploads, or any data that must outlive a container. Anonymous volumes
(no name) are only removed automatically when the container was started with --rm
or removed with docker rm -v; otherwise they accumulate and must be pruned manually.
Common driver_opts for the default local driver: bind-mount an existing host path
with {"type": "none", "device": "/host/path", "o": "bind"}, or mount an NFS share
with {"type": "nfs", "device": "server:/export", "o": "addr=server,rw"}. Third-party
drivers (e.g. rexray, convoy) accept their own option keys.
args: name - Volume name; auto-generated if omitted (creates an anonymous volume) driver - Volume driver to use (default: "local") driver_opts - Driver-specific options dict labels - Labels to set on the volume returns: dict - The created volume's attrs
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| driver | No | ||
| labels | No | ||
| driver_opts | No |