Merge pull request #4917 from ColinHebert/docker_documentation

provider/docker: Update documentation
This commit is contained in:
James Nugent 2016-01-30 17:18:07 -05:00
commit 8e4f976193
4 changed files with 35 additions and 22 deletions

View File

@ -44,7 +44,8 @@ The following arguments are supported:
`["/usr/bin/myprogram"]`.
* `dns` - (Optional, set of strings) Set of DNS servers.
* `env` - (Optional, set of strings) Environmental variables to set.
* `labels` - (Optional) Key/value pairs to set as labels on the container.
* `labels` - (Optional, map of strings) Key/value pairs to set as labels on the
container.
* `links` - (Optional, set of strings) Set of links for link based
connectivity between containers that are running on the same host.
* `hostname` - (Optional, string) Hostname of the container.
@ -56,24 +57,26 @@ The following arguments are supported:
* `must_run` - (Optional, bool) If true, then the Docker container will be
kept running. If false, then as long as the container exists, Terraform
assumes it is successful.
* `ports` - (Optional) See [Ports](#ports) below for details.
* `host_entry` - (Optional) See [Extra Hosts](#extra_hosts) below for details.
* `ports` - (Optional, block) See [Ports](#ports) below for details.
* `host_entry` - (Optional, block) See [Extra Hosts](#extra_hosts) below for
details.
* `privileged` - (Optional, bool) Run container in privileged mode.
* `publish_all_ports` - (Optional, bool) Publish all ports of the container.
* `volumes` - (Optional) See [Volumes](#volumes) below for details.
* `volumes` - (Optional, block) See [Volumes](#volumes) below for details.
* `memory` - (Optional, int) The memory limit for the container in MBs.
* `memory_swap` - (Optional, int) The total memory limit (memory + swap) for the
container in MBs.
* `cpu_shares` - (Optional, int) CPU shares (relative weight) for the container.
* `log_driver` - (Optional, string) The logging driver to use for the container.
Defaults to "json-file".
* `log_opts` - (Optional) Key/value pairs to use as options for the logging
driver.
* `network_mode` - (Optional) Network mode of the container.
* `networks` - (Optional, set of strings) Id of the networks in which the container is.
* `log_opts` - (Optional, map of strings) Key/value pairs to use as options for
the logging driver.
* `network_mode` - (Optional, string) Network mode of the container.
* `networks` - (Optional, set of strings) Id of the networks in which the
container is.
<a id="ports"></a>
## Ports
### Ports
`ports` is a block within the configuration that can be repeated to specify
the port mappings of the container. Each `ports` block supports
@ -86,7 +89,7 @@ the following:
defaults to TCP.
<a id="extra_hosts"></a>
## Extra Hosts
### Extra Hosts
`host_entry` is a block within the configuration that can be repeated to specify
the extra host mappings for the container. Each `host_entry` block supports
@ -99,7 +102,7 @@ This is equivalent to using the `--add-host` option when using the `run`
command of the Docker CLI.
<a id="volumes"></a>
## Volumes
### Volumes
`volumes` is a block within the configuration that can be repeated to specify
the volumes attached to a container. Each `volumes` block supports
@ -115,7 +118,7 @@ the following:
volume will be mounted.
* `read_only` - (Optional, bool) If true, this volume will be readonly.
Defaults to false.
One of `from_container`, `host_path` or `volume_name` must be set.
## Attributes Reference

View File

@ -28,9 +28,9 @@ resource "docker_image" "ubuntu" {
The following arguments are supported:
* `name` - (Required) The name of the Docker image, including any tags.
* `keep_updated` - (Optional) If true, then the Docker image will always
be updated on the host to the latest. If this is false, as long as an
* `name` - (Required, string) The name of the Docker image, including any tags.
* `keep_updated` - (Optional, boolean) If true, then the Docker image will
always be updated on the host to the latest. If this is false, as long as an
image is downloaded with the correct tag, it won't be redownloaded if
there is a newer image.

View File

@ -20,7 +20,7 @@ resource "docker_network" "private_network" {
name = "my_network"
}
# Access it somewhere else with ${docker_image.docker_network.name}
# Access it somewhere else with ${docker_network.private_network.name}
```
## Argument Reference
@ -28,11 +28,20 @@ resource "docker_network" "private_network" {
The following arguments are supported:
* `name` - (Required, string) The name of the Docker network.
* `check_duplicate` - (Optional, boolean) Requests daemon to check for networks with same name.
* `driver` - (Optional, string) Name of the network driver to use. Defaults to `bridge` driver.
* `options` - (Optional, map of strings) Network specific options to be used by the drivers.
* `ipam_driver` - (Optional, string) Driver used by the custom IP scheme of the network.
* `ipam_config` - (Optional, block) Configuration of the custom IP scheme of the network.
* `check_duplicate` - (Optional, boolean) Requests daemon to check for networks
with same name.
* `driver` - (Optional, string) Name of the network driver to use. Defaults to
`bridge` driver.
* `options` - (Optional, map of strings) Network specific options to be used by
the drivers.
* `ipam_driver` - (Optional, string) Driver used by the custom IP scheme of the
network.
* `ipam_config` - (Optional, block) See [IPAM config](#ipam_config) below for
details.
<a id="ipam_config"></a>
### IPAM config
Configuration of the custom IP scheme of the network.
The `ipam_config` block supports:

View File

@ -27,7 +27,8 @@ resource "docker_volume" "shared_volume" {
The following arguments are supported:
* `name` - (Optional, string) The name of the Docker volume (generated if not provided).
* `name` - (Optional, string) The name of the Docker volume (generated if not
provided).
* `driver` - (Optional, string) Driver type for the volume (defaults to local).
* `driver_opts` - (Optional, map of strings) Options specific to the driver.