简体   繁体   中英

DCOS: Update service with newer image having the same tag

I have set up a marathon service with a .json definition as the one below:

{
  "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": []
}

assuming my CI/CD pipeline creates a NEWER my-docker-registry/repository/imagename:dev image, how do i force update the service to pull the latest image (I want to keep the tag constant to avoid flooding my registry)

由于您已经启用了forcePullImage ,因此只需重新启动服务就足以拉出新版本。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM