Section: Swarm Basics

Add node label

bash
bash
docker node update --label-add zone=us-east-1a worker-1
Explanation

Labels are useful for placement constraints.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Swarm Basics
List swarm nodes
List nodes in the swarm.
OpenIn sheetbashsame section
Inspect a node
Show low-level swarm node details.
OpenIn sheetbashsame section
Drain a node
Mark a node unavailable for task scheduling.
OpenIn sheetbashsame section
Initialize swarm
Initialize the current engine as a swarm manager.
OpenIn sheetbashsame section
Initialize swarm with advertise address
Initialize swarm and advertise a specific manager IP.
OpenIn sheetbashsame section
Show worker join token
Show or rotate the worker join token.
OpenIn sheetbashsame section