2023-11-10 19:22:06 +00:00
|
|
|
resource "docker_container" "{{.Node.DockerName}}-{{.Workload.ID.TFString}}" {
|
|
|
|
name = "{{.Node.DockerName}}-{{.Workload.ID.TFString}}"
|
2023-07-17 22:15:22 +00:00
|
|
|
network_mode = "container:${docker_container.{{.PodName}}.id}"
|
2023-11-02 19:25:48 +00:00
|
|
|
image = docker_image.{{.ImageResource}}.image_id
|
2023-07-17 22:15:22 +00:00
|
|
|
restart = "on-failure"
|
|
|
|
|
|
|
|
{{- range $k, $v := .Labels }}
|
|
|
|
labels {
|
|
|
|
label = "{{ $k }}"
|
|
|
|
value = "{{ $v }}"
|
|
|
|
}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
env = [
|
2023-11-10 19:22:06 +00:00
|
|
|
{{- range .Workload.Env }}
|
2023-07-17 22:15:22 +00:00
|
|
|
"{{.}}",
|
|
|
|
{{- end}}
|
|
|
|
]
|
|
|
|
|
|
|
|
command = [
|
2023-11-10 19:22:06 +00:00
|
|
|
{{- range .Workload.Command }}
|
2023-07-17 22:15:22 +00:00
|
|
|
"{{.}}",
|
|
|
|
{{- end }}
|
|
|
|
]
|
|
|
|
}
|