docker-archive / classicswarm

Swarm Classic: a container clustering system. Not to be confused with Docker Swarm which is at https://github.com/docker/swarmkit
Apache License 2.0
5.75k stars 1.08k forks source link

How to set the unique environments for tasks on every node in docker swarm? #2964

Closed arvitaly closed 4 years ago

arvitaly commented 5 years ago

Hello! Some arguments of docker service create allow to use template like {{.Node.ID}}. But unfortunately node labels are not supported. What is the right way for a decision of this problem: I need to set the environment variables for every task.

For example:

docker service create --env SOME_ENV="{{.Node.Labels.SOME_NODE_LABEL_VALUE}}"

In this way, I need to configure docker service's task especially for every swarm's node.

justincormack commented 4 years ago

This issue is for https://github.com/docker/swarmkit not the old standalone Swarm.