在Day 9. Hashicorp Nomad: Task dependencies 有提到用 lifecycle
來設定task相依性,你應該猜到了要設定sidecar只要修改sidecar = true
即可。
...
task "filebeat" {
driver = "docker"
config {
image = "store/elastic/filebeat:7.14.1"
args = [
"--name","filebeat","--volume","/var/xxx:/a/b/c","-p", "8080", ...
]
}
lifecycle {
hook = "prestart"
sidecar = true
}
}
task "webserver" {
...
}
...