Is that what docker service --label is for? Can anybody explain what the --label does?
Which docker command has --label?
You can launch your various docker engines with labels of your choosing and then use those labels in constraints when launching containers in a swarm. So, for example:
dockerd --label region=east --label env=prod ...
And then when running containers in your swarm:
docker run -it -e constraint:region==east busybox
The container will only launch on a node with that label. See the swarm filter docs for more details.
The command is docker service
Thanks. If this actually works that’s great. I’m going to test it out for sure.