我用游牧安排要在多个节点部署泊坞图像。我正在使用一个非常稳定的图像,所以我希望在本地加载该图像,而不是每次都从Dockerhub中获取。
docker.cleanup.image
参数应该这样做:
docker.cleanup.image
默认为true。将此更改为false将阻止Nomad从已停止的任务中删除图像,这正是我想要的。
文档示例是:
client {
options {
"docker.cleanup.image" = "false"
}
}
但是,我不知道这节节的去向。我尝试将其放在相当简单的配置文件的job
或task
部分,但没有成功。
job "example" {
datacenters = ["dc1"]
type = "service"
update {
max_parallel = 30
min_healthy_time = "10s"
healthy_deadline = "3m"
auto_revert = false
canary = 0
}
group "cache" {
count = 30
restart {
attempts = 10
interval = "5m"
delay = "25s"
mode = "delay"
}
ephemeral_disk {
size = 300
}
task "redis" {
driver = "docker"
config {
image = "whatever/whatever:v1"
port_map {
db = 80
}
}
env {
"LOGGER" = "ec2-52-58-216-66.eu-central-1.compute.amazonaws.com"
}
resources {
network {
mbits = 10
port "db" {}
}
}
service {
name = "global-redis-check"
tags = ["global", "cache"]
port = "db"
}
}
}
}
我在哪里将client
节放在nomad配置文件中?
答案 0 :(得分:0)
这不会进入您的工作文件,它会在nomad代理(部署了nomad作业的客户端)上运行。