Skip to content

Instantly share code, notes, and snippets.

@lily-mara
Created July 13, 2016 18:36
Show Gist options
  • Save lily-mara/3bffa2c9bca704c78cf5359406b2ba12 to your computer and use it in GitHub Desktop.
Save lily-mara/3bffa2c9bca704c78cf5359406b2ba12 to your computer and use it in GitHub Desktop.
provider "docker" {
host = "unix:///var/run/docker.sock"
}
resource "docker_container" "foo" {
image = "${docker_image.alpine.latest}"
name = "foo"
command = ["/bin/cat", "/etc/issue"]
}
resource "docker_image" "alpine" {
name = "alpine:latest"
}
docker_image.alpine: Refreshing state... (ID: sha256:4e38e38c8ce0b8d9041a9c4fefe786631d1416225e13b0bfe8cfa2321aec4bbaalpine:latest)
docker_container.foo: Refreshing state... (ID: 8034d8f1dfbb6959de8749960db27b4d138ae4c23601bd1bd88845bc15c2fc30)
docker_container.foo: Creating...
bridge: "" => "<computed>"
command.#: "" => "2"
command.0: "" => "/bin/cat"
command.1: "" => "/etc/issue"
gateway: "" => "<computed>"
image: "" => "sha256:4e38e38c8ce0b8d9041a9c4fefe786631d1416225e13b0bfe8cfa2321aec4bba"
ip_address: "" => "<computed>"
ip_prefix_length: "" => "<computed>"
log_driver: "" => "json-file"
must_run: "" => "1"
name: "" => "foo"
restart: "" => "no"
Error applying plan:
1 error(s) occurred:
* docker_container.foo: Unable to start container: API error (400): {"message":"starting container with HostConfig was deprecated since v1.10 and removed in v1.12"}
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment