You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/testing/deployer/sprawl/internal/tfgen/templates/container-pause.tf.tmpl

40 lines
841 B

resource "docker_container" "{{.PodName}}" {
name = "{{.PodName}}"
image = docker_image.pause.image_id
hostname = "{{.PodName}}"
restart = "always"
dns = ["{{.DNSAddress}}"]
{{- range $k, $v := .Labels }}
labels {
label = "{{ $k }}"
value = "{{ $v }}"
}
{{- end }}
depends_on = [
docker_container.{{.DockerNetworkName}}-coredns,
docker_container.{{.DockerNetworkName}}-forwardproxy,
]
{{- range .Ports }}
ports {
internal = {{.}}
}
{{- end }}
network_mode = "bridge"
{{- range .Node.Addresses }}
networks_advanced {
name = docker_network.{{.DockerNetworkName}}.name
ipv4_address = "{{.IPAddress}}"
}
{{- end }}
}
output "ports_{{.Node.Cluster}}_{{.Node.Partition}}_{{.Node.Name}}" {
value = {
for port in docker_container.{{.PodName}}.ports : port.internal => port.external
}
}