docs(service create): note global mode still honors constraints

A global service is one task per matching node, not one per
node in the swarm. Say that next to --mode and --constraint.

Signed-off-by: Dean Chen <862469039@qq.com>
This commit is contained in:
Dean Chen
2026-08-15 21:36:19 +05:00
parent 8659aa5d4c
commit 3c53edb6c5
+5 -2
View File
@@ -676,7 +676,9 @@ $ docker service create \
The service mode determines whether this is a _replicated_ service or a _global_
service. A replicated service runs as many tasks as specified, while a global
service runs on each active node in the swarm.
service runs one task on each active node in the swarm. Placement
`--constraint` expressions still apply: a global service only schedules
that task on nodes that match, not on every node.
The following command creates a global service:
@@ -690,7 +692,8 @@ $ docker service create \
### <a name="constraint"></a> Specify service constraints (--constraint)
You can limit the set of nodes where a task can be scheduled by defining
constraint expressions. Constraint expressions can either use a _match_ (`==`)
constraint expressions. They apply to both replicated and global services
(and to jobs). Constraint expressions can either use a _match_ (`==`)
or _exclude_ (`!=`) rule. Multiple constraints find nodes that satisfy every
expression (AND match). Constraints can match node or Docker Engine labels as
follows: