dockermesosdcos

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)


Solution

  • As you already have forcePullImage enabled, a simple restart of the service should be enough to pull the new version.