volume_create
Create a named or anonymous Docker volume for persistent data storage, with options to specify driver, labels, and driver-specific options like 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. List existing volumes with
volume_list; reclaim unused ones with volume_prune. Created volumes are stamped with provenance
labels.
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 full document (keys include Name, Driver, Mountpoint, CreatedAt, Labels, Options, Scope)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| driver | No | ||
| labels | No | ||
| driver_opts | No |