website/docs: Run terraform fmt on code examples (#12075)

* docs/vsphere: Fix code block

* docs: Convert `...` to `# ...` to allow `terraform fmt`ing

* docs: Trim trailing whitespace

* docs: First-pass run of `terraform fmt` on code examples
This commit is contained in:
George Christou 2017-02-18 22:48:50 +00:00 committed by Paul Stack
parent c5ccb7a65c
commit f45feac72c
6 changed files with 17 additions and 14 deletions

View file

@ -18,12 +18,12 @@ to date on the latest available version of the tag.
```
data "docker_registry_image" "ubuntu" {
name = "ubuntu:precise"
name = "ubuntu:precise"
}
resource "docker_image" "ubuntu" {
name = "${data.docker_registry_image.ubuntu.name}"
pull_triggers = ["${data.docker_registry_image.ubuntu.sha256_digest}"]
name = "${data.docker_registry_image.ubuntu.name}"
pull_triggers = ["${data.docker_registry_image.ubuntu.sha256_digest}"]
}
```

View file

@ -27,17 +27,17 @@ is a Docker feature missing, please report it in the GitHub repo.
```
# Configure the Docker provider
provider "docker" {
host = "tcp://127.0.0.1:2376/"
host = "tcp://127.0.0.1:2376/"
}
# Create a container
resource "docker_container" "foo" {
image = "${docker_image.ubuntu.latest}"
name = "foo"
image = "${docker_image.ubuntu.latest}"
name = "foo"
}
resource "docker_image" "ubuntu" {
name = "ubuntu:latest"
name = "ubuntu:latest"
}
```

View file

@ -15,7 +15,7 @@ Manages the lifecycle of a Docker container.
```
# Start a container
resource "docker_container" "ubuntu" {
name = "foo"
name = "foo"
image = "${docker_image.ubuntu.latest}"
}

View file

@ -21,22 +21,23 @@ data source to update the `pull_triggers` field.
```
# Find the latest Ubuntu precise image.
resource "docker_image" "ubuntu" {
name = "ubuntu:precise"
name = "ubuntu:precise"
}
# Access it somewhere else with ${docker_image.ubuntu.latest}
```
### Dynamic image
```
data "docker_registry_image" "ubuntu" {
name = "ubuntu:precise"
name = "ubuntu:precise"
}
resource "docker_image" "ubuntu" {
name = "${data.docker_registry_image.ubuntu.name}"
pull_triggers = ["${data.docker_registry_image.ubuntu.sha256_digest}"]
name = "${data.docker_registry_image.ubuntu.name}"
pull_triggers = ["${data.docker_registry_image.ubuntu.sha256_digest}"]
}
```

View file

@ -17,10 +17,11 @@ to create virtual networks within the docker environment.
```
# Find the latest Ubuntu precise image.
resource "docker_network" "private_network" {
name = "my_network"
name = "my_network"
}
# Access it somewhere else with ${docker_network.private_network.name}
```
## Argument Reference

View file

@ -17,10 +17,11 @@ to prepare volumes that can be shared across containers.
```
# Creates a docker volume "shared_volume".
resource "docker_volume" "shared_volume" {
name = "shared_volume"
name = "shared_volume"
}
# Reference the volume with ${docker_volume.shared_volume.name}
```
## Argument Reference