【问题标题】:DCOS: Update service with newer image having the same tagDCOS:使用具有相同标签的较新映像更新服务
【发布时间】:2019-07-18 23:19:28
【问题描述】:

我已经设置了 .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 图像,我如何强制更新服务以提取最新图像(我想保留 @ 987654324@ 常量以避免充斥我的注册表)

【问题讨论】:

    标签: docker mesos dcos


    【解决方案1】:

    由于您已经启用了forcePullImage,因此只需重新启动服务即可拉取新版本。

    【讨论】:

      猜你喜欢
      • 2017-12-12
      • 2020-02-27
      • 1970-01-01
      • 1970-01-01
      • 2019-08-21
      • 2019-01-30
      • 2022-10-28
      • 1970-01-01
      • 2014-10-20
      相关资源
      最近更新 更多