Cli: Include an "order" key in the "update_config"

Created on 18 Jul 2017  路  7Comments  路  Source: docker/cli

When updating a Docker service, the following option exists:

      --update-order string                Update order ("start-first"|"stop-first")

This can be used to create rolling update deployments, even if a service has just one replica.

I propose adding the following key to the Docker Compose spec, which will allow for these updates to work with docker deploy -c ....

    deploy:
      replicas: 1
      update_config:
        parallelism: 1
        order: start-first | stop-first

I would be happy to contribute the needed code if that's something we'd like to have in the spec.

arestack exbeginner

Most helpful comment

Can we use it as a zero downtime deployment during docker service update. In docker docs I could not find any real life example for using this option. Could you please give us some brief how does this new option works. we have a Global mode service running and if we add this option in stack file how at the same time both the containers will access the same port. Because as per our understanding when the new task or container become ready in our case curl that port then old task or container will be shutdown. So at one moment there would be port conflict happened. Or the theory is different.

All 7 comments

Sounds good. This should go into v3.4, with #305 and #306

Cool @dnephin, I can draft a PR if you'd like within the week 馃槃

That would be great. Just cherry-pick the first commit from #306 to get the new v3.4 schema file

Hello @dnephin - https://github.com/docker/cli/pull/306/commits/5b43e146e6a4a5767383e1c766bf6e943a6a1c61 seems to change the v3.3 format, not v3.4, am I missing something?

Also, is there a way I can populate the format, after adding the new options to config_schema_v3.4.json? Sorry if that's too obvious 馃槆

Here's a first implementation, which currently fails because of the format not being there: https://github.com/akalipetis/cli/commit/1de7d378cd172b2d9f105ac892b1395e69356555

Ah sorry. My commit from #306 was dropped with a force push I guess.

I've opened #358 with the commit

Thanks 馃憤 cherry-picked and opened #360 馃帀

Can we use it as a zero downtime deployment during docker service update. In docker docs I could not find any real life example for using this option. Could you please give us some brief how does this new option works. we have a Global mode service running and if we add this option in stack file how at the same time both the containers will access the same port. Because as per our understanding when the new task or container become ready in our case curl that port then old task or container will be shutdown. So at one moment there would be port conflict happened. Or the theory is different.

Was this page helpful?
0 / 5 - 0 ratings