From 3930cc2712da2a7b13414b1caed61298f7ab7733 Mon Sep 17 00:00:00 2001 From: Dean Chen <862469039@qq.com> Date: Sun, 16 Aug 2026 01:38:40 +0500 Subject: [PATCH] docs(service create): explain start-first vs stop-first Default stop-first drops the VIP backend until the new task is up. start-first keeps one healthy backend the whole time. Signed-off-by: Dean Chen <862469039@qq.com> --- docs/reference/commandline/service_create.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/reference/commandline/service_create.md b/docs/reference/commandline/service_create.md index ddb6a3a0832c..e4ec6377bcee 100644 --- a/docs/reference/commandline/service_create.md +++ b/docs/reference/commandline/service_create.md @@ -249,6 +249,19 @@ maximum of 2 tasks at a time, with `10s` between updates. For more information, refer to the [rolling updates tutorial](https://docs.docker.com/engine/swarm/swarm-tutorial/rolling-update/). +`--update-order` (and `--rollback-order`) pick whether a new task starts +before or after the old one stops: + +- `stop-first` (default) — stop the old task, then start the replacement. + The published VIP has one fewer backend for that slot until the new + task is Running. +- `start-first` — start the new task first and wait until it is Running + before stopping the old one. The VIP keeps a healthy backend (old, then + both, then new). Needs enough spare capacity on the node for the extra + task. + +`--rollback-order` is the same idea when a rollback runs. + ### Set environment variables (-e, --env) This sets an environment variable for all tasks in a service. For example: