{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/24110","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/24110/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/24110/comments","events_url":"https://api.github.com/repos/docker/docker/issues/24110/events","html_url":"https://github.com/docker/docker/issues/24110","id":162893018,"number":24110,"title":"Pass swarm task information as environment variables into each task","user":{"login":"F21","id":2263040,"avatar_url":"https://avatars.githubusercontent.com/u/2263040?v=3","gravatar_id":"","url":"https://api.github.com/users/F21","html_url":"https://github.com/F21","followers_url":"https://api.github.com/users/F21/followers","following_url":"https://api.github.com/users/F21/following{/other_user}","gists_url":"https://api.github.com/users/F21/gists{/gist_id}","starred_url":"https://api.github.com/users/F21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/F21/subscriptions","organizations_url":"https://api.github.com/users/F21/orgs","repos_url":"https://api.github.com/users/F21/repos","events_url":"https://api.github.com/users/F21/events{/privacy}","received_events_url":"https://api.github.com/users/F21/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/area/swarm","name":"area/swarm","color":"fbca04"},{"url":"https://api.github.com/repos/docker/docker/labels/kind/enhancement","name":"kind/enhancement","color":"E8CAAF"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2016-06-29T10:31:10Z","updated_at":"2016-07-25T10:09:46Z","closed_at":null,"body":"I am interested in running HDFS using swarm. One of the requirements of HDFS is a Zookeeper ensemble. To operate a Zookeeper ensemble, each Zookeeper should have a unique ID, starting from 1 and ending in 255.\r\n\r\nWhile it is possible to coordinate the ids using something like consul or etcd, it would be much simpler for swarm to pass in task information as environment variables into each task. For example:\r\n\r\n- `SWARM_TASK_ID`\r\n- `SWARM_SERVICE_NAME`\r\n- ...\r\n\r\nThese variables can then be used by the containers to simplify orchestration."},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/234914167","html_url":"https://github.com/docker/docker/issues/24110#issuecomment-234914167","issue_url":"https://api.github.com/repos/docker/docker/issues/24110","id":234914167,"user":{"login":"AkihiroSuda","id":9248427,"avatar_url":"https://avatars.githubusercontent.com/u/9248427?v=3","gravatar_id":"","url":"https://api.github.com/users/AkihiroSuda","html_url":"https://github.com/AkihiroSuda","followers_url":"https://api.github.com/users/AkihiroSuda/followers","following_url":"https://api.github.com/users/AkihiroSuda/following{/other_user}","gists_url":"https://api.github.com/users/AkihiroSuda/gists{/gist_id}","starred_url":"https://api.github.com/users/AkihiroSuda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AkihiroSuda/subscriptions","organizations_url":"https://api.github.com/users/AkihiroSuda/orgs","repos_url":"https://api.github.com/users/AkihiroSuda/repos","events_url":"https://api.github.com/users/AkihiroSuda/events{/privacy}","received_events_url":"https://api.github.com/users/AkihiroSuda/received_events","type":"User","site_admin":false},"created_at":"2016-07-25T10:09:46Z","updated_at":"2016-07-25T10:09:46Z","body":"@stevvooe\r\n\r\n\r\n>> Such dynamic data cannot be supported by the -e ZKID={{.Task.Slot}} approach.\r\n\r\n> Untrue. You just make a new container.\r\n\r\nIn my understanding https://github.com/docker/docker/issues/21721 will support adding a label to a running container, rather than making a new container.\r\n\r\n>> I don't think it makes apps less portable.\r\n\r\n> It does. Apps that integrate directly with some disk layout will be tied to that version of the data layout. If all you need is some particular value for an application, it is much more portable to populate an application defined env variable with a value from the context than to integrate with an introspection API.\r\n\r\n@mcassaniti 's proposal (`API-ver`) can improve portability.\r\n\r\n"}}
{"actor":{"display_login":"AkihiroSuda"}}