📅  最后修改于: 2023-12-03 15:30:31.784000             🧑  作者: Mango
The docker node label add
command is used to add a label to a Docker Swarm node. Labels are used to tag nodes with metadata that can be used for filtering tasks or managing services.
docker node label add <NODE> <LABEL>
NODE
: The ID or name of the node to add the label to.LABEL
: The label to add in the format key=value
.docker node label add worker-1 environment=production
This command will add the label environment=production
to the node named worker-1
.
--label
option of the docker swarm join
command.docker node label rm
command.