Terraform and docker networking -
i have defined terraform recipe docker provisioner this:
provider "docker" { host = "tcp://127.0.0.1:2375/" } # create network resource "docker_network" "private_network" { name = "${var.customer_name}_network" } resource "docker_container" "goagent" { image = "${docker_image.goagent.latest}" name = "${var.customer_name}_goagent" command = [ "/bin/sh", "-c", "/usr/bin/supervisord" ] network_mode = "bridge" networks = [ "${docker_network.private_network.name}" ] hostname = "${var.customer_name}_goagent" } resource "docker_image" "goagent" { name = "local/goagent" }
i expect container connected network created on fly (using variable customer_name). see container gets connected default bridge network (172.17.0.0/16), gets connected 2 networks.
is there way configure container in terraform in way gets connected network specify in networks list?
apparently unresolved bug of 0.10.8
Comments
Post a Comment