terraform-provider-docker/website/docs/r/volume.html.markdown
Boris HUISGEN eca96b960b Add labels to support docker stacks (#92)
* Add network labels and options attachable, ingress and ipv6
* Add volume labels
* Add secret labels
* Updates documentation
2018-10-18 12:39:58 +02:00

1.1 KiB

layout page_title sidebar_current description
docker Docker: docker_volume docs-docker-resource-volume Creates and destroys docker volumes.

docker_volume

Creates and destroys a volume in Docker. This can be used alongside docker_container to prepare volumes that can be shared across containers.

Example Usage

# Creates a docker volume "shared_volume".
resource "docker_volume" "shared_volume" {
  name = "shared_volume"
}

# Reference the volume with ${docker_volume.shared_volume.name}

Argument Reference

The following arguments are supported:

  • name - (Optional, string) The name of the Docker volume (generated if not provided).
  • labels - (Optional, map of string/string key/value pairs) User-defined key/value metadata.
  • driver - (Optional, string) Driver type for the volume (defaults to local).
  • driver_opts - (Optional, map of strings) Options specific to the driver.

Attributes Reference

The following attributes are exported in addition to the above configuration:

  • mountpoint (string) - The mountpoint of the volume.