website: docker docs
This commit is contained in:
parent
a7a5d2e564
commit
2f0235b23d
|
@ -10,6 +10,7 @@ body.layout-atlas,
|
|||
body.layout-consul,
|
||||
body.layout-dnsimple,
|
||||
body.layout-dme,
|
||||
body.layout-docker,
|
||||
body.layout-cloudflare,
|
||||
body.layout-cloudstack,
|
||||
body.layout-google,
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
---
|
||||
layout: "docker"
|
||||
page_title: "Provider: Docker"
|
||||
sidebar_current: "docs-docker-index"
|
||||
description: |-
|
||||
The Docker provider is used to interact with Docker containers and images.
|
||||
---
|
||||
|
||||
# Docker Provider
|
||||
|
||||
The Docker provider is used to interact with Docker containers and images.
|
||||
It uses the Docker API to manage the lifecycle of Docker containers. Because
|
||||
the Docker provider uses the Docker API, it is immediatel compatible not
|
||||
only with single server Docker but Swarm and any additional Docker-compatible
|
||||
API hosts.
|
||||
|
||||
Use the navigation to the left to read about the available resources.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
# Configure the Docker provider
|
||||
provider "docker" {
|
||||
host = "tcp://127.0.0.1:1234/"
|
||||
}
|
||||
|
||||
# Create a container
|
||||
resource "docker_container" "foo" {
|
||||
image = "${docker_image.ubuntu.latest}"
|
||||
name = "foo"
|
||||
}
|
||||
|
||||
resource "docker_image" "ubuntu" {
|
||||
name = "ubuntu:latest"
|
||||
}
|
||||
```
|
||||
|
||||
## Argument Reference
|
||||
|
||||
The following arguments are supported:
|
||||
|
||||
* `host` - (Required) This is the address to the Docker host. If this is
|
||||
blank, the `DOCKER_HOST` environment variable will also be read.
|
||||
|
||||
* `cert_path` - (Optional) Path to a directory with certificate information
|
||||
for connecting to the Docker host via TLS. If this is blank, the
|
||||
`DOCKER_CERT_PATH` will also be checked.
|
|
@ -0,0 +1,77 @@
|
|||
---
|
||||
layout: "docker"
|
||||
page_title: "Docker: docker_container"
|
||||
sidebar_current: "docs-docker-resource-container"
|
||||
description: |-
|
||||
Manages the lifecycle of a Docker container.
|
||||
---
|
||||
|
||||
# docker\_container
|
||||
|
||||
Manages the lifecycle of a Docker container.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
# Start a container
|
||||
resource "docker_container" "ubuntu" {
|
||||
name = "foo"
|
||||
image = "${docker_image.ubuntu.latest}"
|
||||
}
|
||||
|
||||
# Find the latest Ubuntu precise image.
|
||||
resource "docker_image" "ubuntu" {
|
||||
image = "ubuntu:precise"
|
||||
}
|
||||
```
|
||||
|
||||
## Argument Reference
|
||||
|
||||
The following arguments are supported:
|
||||
|
||||
* `name` - (Required, string) The name of the Docker container.
|
||||
* `image` - (Required, string) The ID of the image to back this container.
|
||||
The easiest way to get this value is to use the `docker_image` resource
|
||||
as is shown in the example above.
|
||||
|
||||
* `command` - (Optional, list of strings) The command to use to start the
|
||||
container.
|
||||
* `dns` - (Optional, set of strings) Set of DNS servers.
|
||||
* `env` - (Optional, set of strings) Environmental variables to set.
|
||||
* `hostname` - (Optional, string) Hostname of the container.
|
||||
* `domainname` - (Optional, string) Domain name of the container.
|
||||
* `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.
|
||||
* `publish_all_ports` - (Optional, bool) Publish all ports of the container.
|
||||
* `volumes` - (Optional) See [Volumes](#volumes) below for details.
|
||||
|
||||
<a id="ports"></a>
|
||||
## Ports
|
||||
|
||||
`ports` is a block within the configuration that can be repeated to specify
|
||||
the port mappings of the container. Each `ports` block supports
|
||||
the following:
|
||||
|
||||
* `internal` - (Required, int) Port within the container.
|
||||
* `external` - (Required, int) Port exposed out of the container.
|
||||
* `ip` - (Optional, string) IP address/mask that can access this port.
|
||||
* `protocol` - (Optional, string) Protocol that can be used over this port,
|
||||
defaults to TCP.
|
||||
|
||||
<a id="volumes"></a>
|
||||
## Volumes
|
||||
|
||||
`volumes` is a block within the configuration that can be repeated to specify
|
||||
the volumes attached to a container. Each `volumes` block supports
|
||||
the following:
|
||||
|
||||
* `from_container` - (Optional, string) The container where the volume is
|
||||
coming from.
|
||||
* `container_path` - (Optional, string) The path in the container where the
|
||||
volume will be mounted.
|
||||
* `host_path` - (Optional, string) The path on the host where the volume
|
||||
is coming from.
|
||||
* `read_only` - (Optinal, bool) If true, this volume will be readonly.
|
||||
Defaults to false.
|
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
layout: "docker"
|
||||
page_title: "Docker: docker_image"
|
||||
sidebar_current: "docs-docker-resource-image"
|
||||
description: |-
|
||||
Downloads and exports the ID of a Docker image.
|
||||
---
|
||||
|
||||
# docker\_image
|
||||
|
||||
Downloads and exports the ID of a Docker image. This can be used alongside
|
||||
[docker\_container](/docs/providers/docker/r/container.html)
|
||||
to programmatically get the latest image IDs without having to hardcode
|
||||
them.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
# Find the latest Ubuntu precise image.
|
||||
resource "docker_image" "ubuntu" {
|
||||
image = "ubuntu:precise"
|
||||
}
|
||||
|
||||
# Access it somewhere else with ${docker_image.ubuntu.latest}
|
||||
```
|
||||
|
||||
## Argument Reference
|
||||
|
||||
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
|
||||
image is downloaded with the correct tag, it won't be redownloaded if
|
||||
there is a newer image.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported in addition to the above configuration:
|
||||
|
||||
* `latest` (string) - The ID of the image.
|
|
@ -0,0 +1,30 @@
|
|||
<% wrap_layout :inner do %>
|
||||
<% content_for :sidebar do %>
|
||||
<div class="docs-sidebar hidden-print affix-top" role="complementary">
|
||||
<ul class="nav docs-sidenav">
|
||||
<li<%= sidebar_current("docs-home") %>>
|
||||
<a href="/docs/index.html">« Documentation Home</a>
|
||||
</li>
|
||||
|
||||
<li<%= sidebar_current("docs-docker-index") %>>
|
||||
<a href="/docs/providers/docker/index.html">Docker Provider</a>
|
||||
</li>
|
||||
|
||||
<li<%= sidebar_current("docs-docker-resource") %>>
|
||||
<a href="#">Resources</a>
|
||||
<ul class="nav nav-visible">
|
||||
<li<%= sidebar_current("docs-docker-resource-container") %>>
|
||||
<a href="/docs/providers/docker/r/container.html">docker_container</a>
|
||||
</li>
|
||||
|
||||
<li<%= sidebar_current("docs-docker-resource-image") %>>
|
||||
<a href="/docs/providers/docker/r/image.html">docker_image</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= yield %>
|
||||
<% end %>
|
|
@ -130,7 +130,7 @@
|
|||
|
||||
<li<%= sidebar_current("docs-providers-do") %>>
|
||||
<a href="/docs/providers/do/index.html">DigitalOcean</a>
|
||||
</li>
|
||||
</li>
|
||||
|
||||
<li<%= sidebar_current("docs-providers-dme") %>>
|
||||
<a href="/docs/providers/dme/index.html">DNSMadeEasy</a>
|
||||
|
@ -140,6 +140,10 @@
|
|||
<a href="/docs/providers/dnsimple/index.html">DNSimple</a>
|
||||
</li>
|
||||
|
||||
<li<%= sidebar_current("docs-providers-docker") %>>
|
||||
<a href="/docs/providers/docker/index.html">Docker</a>
|
||||
</li>
|
||||
|
||||
<li<%= sidebar_current("docs-providers-google") %>>
|
||||
<a href="/docs/providers/google/index.html">Google Cloud</a>
|
||||
</li>
|
||||
|
|
Loading…
Reference in New Issue