DCOS:使用具有相同标签的较新图像更新服务
DCOS: Update service with newer image having the same tag
我已经设置了一个马拉松服务,.json
定义如下:
{
"env": {
"SOMEVAR": "somevalue"
"labels": {
"HAPROXY_GROUP": "external",
"HAPROXY_0_VHOST": "someurl"
},
"id": "/mycontainer",
"backoffFactor": 1.15,
"backoffSeconds": 1,
"container": {
"portMappings": [
{
"containerPort": 1111,
"hostPort": 1111,
"labels": {
"VIP_0": "/myservice:5601"
},
"protocol": "tcp",
"servicePort": 10004,
"name": "myservice"
}
],
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "my-docker-registry/repository/imagename:dev",
"forcePullImage": true,
"privileged": false,
"parameters": []
}
},
"cpus": 1,
"disk": 0,
"instances": 1,
"maxLaunchDelaySeconds": 3600,
"mem": 1300,
"gpus": 0,
"networks": [
{
"mode": "container/bridge"
}
],
"requirePorts": false,
"upgradeStrategy": {
"maximumOverCapacity": 1,
"minimumHealthCapacity": 1
},
"killSelection": "YOUNGEST_FIRST",
"unreachableStrategy": {
"inactiveAfterSeconds": 0,
"expungeAfterSeconds": 0
},
"healthChecks": [],
"fetch": [],
"constraints": []
}
假设我的 CI/CD 管道创建了一个 NEWER my-docker-registry/repository/imagename:dev
图像,我如何 force 更新服务拉取最新的图像(我想保持 tag
不变以避免淹没我的注册表)
因为您已经启用了 forcePullImage
,只需重新启动服务就足以拉取新版本。
我已经设置了一个马拉松服务,.json
定义如下:
{
"env": {
"SOMEVAR": "somevalue"
"labels": {
"HAPROXY_GROUP": "external",
"HAPROXY_0_VHOST": "someurl"
},
"id": "/mycontainer",
"backoffFactor": 1.15,
"backoffSeconds": 1,
"container": {
"portMappings": [
{
"containerPort": 1111,
"hostPort": 1111,
"labels": {
"VIP_0": "/myservice:5601"
},
"protocol": "tcp",
"servicePort": 10004,
"name": "myservice"
}
],
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "my-docker-registry/repository/imagename:dev",
"forcePullImage": true,
"privileged": false,
"parameters": []
}
},
"cpus": 1,
"disk": 0,
"instances": 1,
"maxLaunchDelaySeconds": 3600,
"mem": 1300,
"gpus": 0,
"networks": [
{
"mode": "container/bridge"
}
],
"requirePorts": false,
"upgradeStrategy": {
"maximumOverCapacity": 1,
"minimumHealthCapacity": 1
},
"killSelection": "YOUNGEST_FIRST",
"unreachableStrategy": {
"inactiveAfterSeconds": 0,
"expungeAfterSeconds": 0
},
"healthChecks": [],
"fetch": [],
"constraints": []
}
假设我的 CI/CD 管道创建了一个 NEWER my-docker-registry/repository/imagename:dev
图像,我如何 force 更新服务拉取最新的图像(我想保持 tag
不变以避免淹没我的注册表)
因为您已经启用了 forcePullImage
,只需重新启动服务就足以拉取新版本。