{"action":"created","issue":{"url":"https://api.github.com/repos/docker/compose/issues/2657","repository_url":"https://api.github.com/repos/docker/compose","labels_url":"https://api.github.com/repos/docker/compose/issues/2657/labels{/name}","comments_url":"https://api.github.com/repos/docker/compose/issues/2657/comments","events_url":"https://api.github.com/repos/docker/compose/issues/2657/events","html_url":"https://github.com/docker/compose/issues/2657","id":126697957,"number":2657,"title":"Can't use linked resource with log driver","user":{"login":"chiefy","id":54345,"avatar_url":"https://avatars.githubusercontent.com/u/54345?v=3","gravatar_id":"","url":"https://api.github.com/users/chiefy","html_url":"https://github.com/chiefy","followers_url":"https://api.github.com/users/chiefy/followers","following_url":"https://api.github.com/users/chiefy/following{/other_user}","gists_url":"https://api.github.com/users/chiefy/gists{/gist_id}","starred_url":"https://api.github.com/users/chiefy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chiefy/subscriptions","organizations_url":"https://api.github.com/users/chiefy/orgs","repos_url":"https://api.github.com/users/chiefy/repos","events_url":"https://api.github.com/users/chiefy/events{/privacy}","received_events_url":"https://api.github.com/users/chiefy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/compose/labels/area/logs","name":"area/logs","color":"c7def8"},{"url":"https://api.github.com/repos/docker/compose/labels/kind/question","name":"kind/question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-01-14T16:56:43Z","updated_at":"2016-02-18T21:18:27Z","closed_at":null,"body":"I'm not sure if this is possible, but I was trying to do something like the following:\r\n\r\n```\r\napp:\r\n  image: nginx\r\n  ports: \r\n    - \"80:80\"\r\n  log_driver: \"gelf\"\r\n  log_opt:\r\n    gelf-address: \"udp://logstash:12201\"\r\n  links:\r\n    - logstash\r\n\r\nlogstash:\r\n  image: logstash\r\n  expose:\r\n    - \"12201/udp\"  \r\n```\r\n\r\nCurrently this won't work, I assume because the log driver tries to initialize before any linking is done?"},"comment":{"url":"https://api.github.com/repos/docker/compose/issues/comments/185926560","html_url":"https://github.com/docker/compose/issues/2657#issuecomment-185926560","issue_url":"https://api.github.com/repos/docker/compose/issues/2657","id":185926560,"user":{"login":"lucj","id":182406,"avatar_url":"https://avatars.githubusercontent.com/u/182406?v=3","gravatar_id":"","url":"https://api.github.com/users/lucj","html_url":"https://github.com/lucj","followers_url":"https://api.github.com/users/lucj/followers","following_url":"https://api.github.com/users/lucj/following{/other_user}","gists_url":"https://api.github.com/users/lucj/gists{/gist_id}","starred_url":"https://api.github.com/users/lucj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucj/subscriptions","organizations_url":"https://api.github.com/users/lucj/orgs","repos_url":"https://api.github.com/users/lucj/repos","events_url":"https://api.github.com/users/lucj/events{/privacy}","received_events_url":"https://api.github.com/users/lucj/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T21:18:27Z","updated_at":"2016-02-18T21:18:27Z","body":"When I test with network_mode: host, I do not manage to have it working though.\r\nMy logstash service needs to have a link towards elasticsearch service (another service of the compose file). But this link is not compatible with the network_mode:\r\n\r\n    ERROR: Conflicting options: host type networking can't be used with links. This would result in undefined behavior\r\n      \r\nThe part of the compose file is:\r\n\r\n      ...\r\n      logstash:\r\n        image: 'myrep/logstash:latest'\r\n        command: 'logstash -f /etc/logstash/conf.d/logstash.conf'\r\n        network_mode: host\r\n        links:\r\n          - elasticsearch\r\n        depends_on:\r\n          - elasticsearch\r\n        expose:\r\n          - '5514'\r\n        restart: on-failure\r\n      logspout:\r\n        image: 'myrep/logspout:latest'\r\n        command: '-c ''/bin/logspout syslog://localhost:5514'''\r\n        entrypoint: /bin/sh\r\n        depends_on:\r\n          - logstash\r\n        restart: always\r\n        volumes:\r\n          - '/var/run/docker.sock:/tmp/docker.sock'\r\n\r\nAny idea of what is wrong ?"}}