{"action":"created","issue":{"url":"https://api.github.com/repos/docker/libnetwork/issues/965","repository_url":"https://api.github.com/repos/docker/libnetwork","labels_url":"https://api.github.com/repos/docker/libnetwork/issues/965/labels{/name}","comments_url":"https://api.github.com/repos/docker/libnetwork/issues/965/comments","events_url":"https://api.github.com/repos/docker/libnetwork/issues/965/events","html_url":"https://github.com/docker/libnetwork/issues/965","id":135768062,"number":965,"title":"Proposal: enable exposure of different ports to different overlay networks","user":{"login":"oiavorskyi","id":217950,"avatar_url":"https://avatars.githubusercontent.com/u/217950?v=3","gravatar_id":"","url":"https://api.github.com/users/oiavorskyi","html_url":"https://github.com/oiavorskyi","followers_url":"https://api.github.com/users/oiavorskyi/followers","following_url":"https://api.github.com/users/oiavorskyi/following{/other_user}","gists_url":"https://api.github.com/users/oiavorskyi/gists{/gist_id}","starred_url":"https://api.github.com/users/oiavorskyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oiavorskyi/subscriptions","organizations_url":"https://api.github.com/users/oiavorskyi/orgs","repos_url":"https://api.github.com/users/oiavorskyi/repos","events_url":"https://api.github.com/users/oiavorskyi/events{/privacy}","received_events_url":"https://api.github.com/users/oiavorskyi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-23T15:29:30Z","updated_at":"2016-02-23T16:40:56Z","closed_at":null,"body":"Pardon me if this feature has been already requested/discussed. I wasn't able to find the respective issue.\r\n\r\nThe `-p <ip>:<port>:<port>` passed to the `docker run` allows to expose particular port to particular network interface of the host. However, I wasn't able to find similar option to expose a port into specific overlay network.\r\n\r\nLet's consider a container that exposes 2 ports - 80 to serve the traffic and 9000 to provide the control/configuration functionality. The port 80 should be exposed to the network \"service\" while the port 9000 should be only exposed to the network \"management\". Currently when the container is added to both networks both ports are exposed. In some cases this would raise security concerns.\r\n\r\nIt would be nice to have ability to expose ports to the specific network (both in docker engine and in docker compose)."},"comment":{"url":"https://api.github.com/repos/docker/libnetwork/issues/comments/187782105","html_url":"https://github.com/docker/libnetwork/issues/965#issuecomment-187782105","issue_url":"https://api.github.com/repos/docker/libnetwork/issues/965","id":187782105,"user":{"login":"mavenugo","id":5056191,"avatar_url":"https://avatars.githubusercontent.com/u/5056191?v=3","gravatar_id":"","url":"https://api.github.com/users/mavenugo","html_url":"https://github.com/mavenugo","followers_url":"https://api.github.com/users/mavenugo/followers","following_url":"https://api.github.com/users/mavenugo/following{/other_user}","gists_url":"https://api.github.com/users/mavenugo/gists{/gist_id}","starred_url":"https://api.github.com/users/mavenugo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mavenugo/subscriptions","organizations_url":"https://api.github.com/users/mavenugo/orgs","repos_url":"https://api.github.com/users/mavenugo/repos","events_url":"https://api.github.com/users/mavenugo/events{/privacy}","received_events_url":"https://api.github.com/users/mavenugo/received_events","type":"User","site_admin":false},"created_at":"2016-02-23T16:40:56Z","updated_at":"2016-02-23T16:40:56Z","body":"@oiavorskyi exposing a port is a container property and hence regardless of the network it is connected to, it must behave the same way. Infact a container can be disconnected from a network and attach to another network and the container must continue to provide the service.\r\n\r\n>> Let's consider a container that exposes 2 ports - 80 to serve the traffic and 9000 to provide the control/configuration functionality.\r\nTypically this is considered as 2 different services and 2 different containers provides these services and exposes ports appropriately to each network. Let the container communicate among them in a private network if required (or share volumes, etc..)"}}