gpt4 book ai didi

json - "forcePullImage"参数设置为 'false'

转载 作者:行者123 更新时间:2023-12-04 14:28:54 24 4
gpt4 key购买 nike

我正在尝试使用 Marathon 构建一个 docker 镜像,但是当我使用此配置时,“forcePullImage”参数被设置为“false”

{
"id": "name",
"mem": 1024,
"cpus": 0.5,
"instances": 1,
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/etc/localtime",
"hostPath": "/etc/localtime",
"mode": "RO"
}
],
"docker": {
"image": "dockerimage",
"network": "BRIDGE",
"portMappings": [ {
"containerPort": 8080,
"hostPort": 0,
"servicePort": [PORTNUMBER],
"protocol": "tcp",
"name": "name"
}],
"parameters": [{ "key": "name", "value": "name" }]
},
"forcePullImage": true
},
"healthChecks": [
{
"path": "~/check/",
"portIndex": 0,
"protocol": "HTTP",
"gracePeriodSeconds": 10,
"intervalSeconds": 2,
"timeoutSeconds": 10,
"maxConsecutiveFailures": 10
}],
"labels":{
"HAPROXY_GROUP":"external"
}
}

当它最终在马拉松环境中构建时,配置文件设置为:

{
"id": "name",
"mem": 1024,
"cpus": 0.5,
"instances": 1,
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/etc/localtime",
"hostPath": "/etc/localtime",
"mode": "RO"
}
],
"docker": {
"image": "dockerimage",
"network": "BRIDGE",
"portMappings": [ {
"containerPort": 8080,
"hostPort": 0,
"servicePort": [PORTNUMBER],
"protocol": "tcp",
"name": "name"
}],
"parameters": [{ "key": "name", "value": "name" }]
},
"forcePullImage": false
},
"healthChecks": [
{
"path": "~/check/",
"portIndex": 0,
"protocol": "HTTP",
"gracePeriodSeconds": 10,
"intervalSeconds": 2,
"timeoutSeconds": 10,
"maxConsecutiveFailures": 10
}],
"labels":{
"HAPROXY_GROUP":"external"
}
}

构建完成后,我必须手动将“false”参数更改为“true”,然后它才能正常工作,但为什么在将它添加到 marathon 时它会设置为 false,我该如何解决这个问题?

最佳答案

您发布的 Marathon 应用规范实际上无效。如果您查看架构,您会看到 forcePullImage has to be a child of docker 字段(不是示例中的 container 字段)。正确的用法是:

"docker": {
"image": "dockerimage",
"forcePullImage": false,
...
}

关于json - "forcePullImage"参数设置为 'false',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39975646/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com