mesosphere / marathon

Deploy and manage containers (including Docker) on top of Apache Mesos at scale.
https://mesosphere.github.io/marathon/
Apache License 2.0
4.07k stars 845 forks source link

how to ask marathon always to run the latest image #3936

Closed yfc845 closed 8 years ago

yfc845 commented 8 years ago

We have marathon run docker images which are located in our private registry as apps, when we do some change to the image and push a new version of image to registry (tag is auto generated in format of "yyyyMMddhhmm"), we would like Marathon to always run the image with the latest time stamp. So I did below things:

In marathon app config, modify the container image to "docker-registry...../app:latest" modify "forcepullimage" to "true"

everytime a image with newer time stamp is pushed, we trigger a restart of the app by marathon api command: curl -X PUT http://marathon.aws.cmcrc.com:8080/v2/apps/{appID} -d '{"instances":0}' -H "Content-type: application/json" and then: curl -X PUT http://marathon.aws.cmcrc.com:8080/v2/apps/{appID} -d '{"instances":1}' -H "Content-type: application/json"

I am expecting that after the restart, marathon will forcely pull the image with the latest time stamp and run it, but the result is not----Marathon is always running the image with the tag: "latest", which does not change when more images with newer time stamps are pushed. So how can we ask Marathon to run the actual latest one? not the tag:"latest" ??

aquamatthias commented 8 years ago

You can set:

 "container": {
    "docker": {
      "forcePullImage": true
    }
}

which per default is false.

yfc845 commented 8 years ago

shouldn't close it.... the answer is not answering at all...anyway thanks for the reply aquamatthias.

My question is:

The latest tag does not represent for the real latest one, most probably.

Is there a way to update the tag:latest image to the same as the real latest one whenever a new one is pushed?

Or is there a way to ask marathon to always run the real latest one? instead of running the latest tag?

azdevops commented 7 years ago

Yes I have the exact same issue, setting forcePullImage to true doesn't solve this