📜  docker node label add - Javascript (1)

📅  最后修改于: 2023-12-03 15:30:31.784000             🧑  作者: Mango

Docker Node Label Add

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.

Syntax
docker node label add <NODE> <LABEL>
Parameters
  • NODE: The ID or name of the node to add the label to.
  • LABEL: The label to add in the format key=value.
Examples
Add a label to a node
docker node label add worker-1 environment=production

This command will add the label environment=production to the node named worker-1.

Notes
  • You can add multiple labels in one command by separating them with a space.
  • Labels can also be added during node creation by using the --label option of the docker swarm join command.
  • Labels can be removed with the docker node label rm command.