{"action":"opened","issue":{"url":"https://api.github.com/repos/docker/compose/issues/1528","labels_url":"https://api.github.com/repos/docker/compose/issues/1528/labels{/name}","comments_url":"https://api.github.com/repos/docker/compose/issues/1528/comments","events_url":"https://api.github.com/repos/docker/compose/issues/1528/events","html_url":"https://github.com/docker/compose/issues/1528","id":86251182,"number":1528,"title":"Compose doesn't collaborate with Swarm when 1 service has 2 dependencies","user":{"login":"jpetazzo","id":171481,"avatar_url":"https://avatars.githubusercontent.com/u/171481?v=3","gravatar_id":"","url":"https://api.github.com/users/jpetazzo","html_url":"https://github.com/jpetazzo","followers_url":"https://api.github.com/users/jpetazzo/followers","following_url":"https://api.github.com/users/jpetazzo/following{/other_user}","gists_url":"https://api.github.com/users/jpetazzo/gists{/gist_id}","starred_url":"https://api.github.com/users/jpetazzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpetazzo/subscriptions","organizations_url":"https://api.github.com/users/jpetazzo/orgs","repos_url":"https://api.github.com/users/jpetazzo/repos","events_url":"https://api.github.com/users/jpetazzo/events{/privacy}","received_events_url":"https://api.github.com/users/jpetazzo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-08T16:44:51Z","updated_at":"2015-06-08T16:44:51Z","closed_at":null,"body":"## What I do\r\n\r\n`docker-compose up` with the following `docker-compose.yml` file, against a 4-nodes Swarm cluster:\r\n\r\n```yaml\r\nhasher:\r\n  image: jpetazzo/dockercoins_hasher:1433781053\r\n  ports: ['8002:80']\r\nredis: {image: redis}\r\nrng:\r\n  image: jpetazzo/dockercoins_rng:1433781053\r\n  ports: ['8001:80']\r\nwebui:\r\n  image: jpetazzo/dockercoins_webui:1433781053\r\n  links: [redis]\r\n  ports: ['8000:80']\r\n  volumes: ['webui/files/:/files/']\r\nworker:\r\n  image: jpetazzo/dockercoins_worker:1433781053\r\n  links: [rng, hasher, redis]\r\n```\r\n\r\n## What I expect\r\n\r\nThe app comes up (with all containers on the same node, since `redis`, `rng`, and `hasher` are all dependencies of `worker`).\r\n\r\n## What I see\r\n\r\nSwarm places `redis`, `rng`, and `hasher` on random nodes. If at least two containers end up on different nodes,  I get the following error:\r\n\r\n```\r\nUnable to find a node fulfilling all dependencies: --link=dockercoins_hasher_1:dockercoins_hasher_1 --link=dockercoins_hasher_1:hasher --link=dockercoins_hasher_1:hasher_1 --link=dockercoins_redis_1:dockercoins_redis_1 --link=dockercoins_redis_1:redis --link=dockercoins_redis_1:redis_1 --link=dockercoins_rng_1:dockercoins_rng_1 --link=dockercoins_rng_1:rng --link=dockercoins_rng_1:rng_1\r\n```\r\n\r\n## Possible resolutions\r\n\r\n- run a full dependency resolution and submit appropriate placement constraints to Swarm\r\n- say that it's Not Our Problem, By Design©\r\n"}}