{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/20987","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/20987/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/20987/comments","events_url":"https://api.github.com/repos/docker/docker/issues/20987/events","html_url":"https://github.com/docker/docker/pull/20987","id":138788834,"number":20987,"title":"add --net options for docker build .","user":{"login":"sandyskies","id":960434,"avatar_url":"https://avatars.githubusercontent.com/u/960434?v=3","gravatar_id":"","url":"https://api.github.com/users/sandyskies","html_url":"https://github.com/sandyskies","followers_url":"https://api.github.com/users/sandyskies/followers","following_url":"https://api.github.com/users/sandyskies/following{/other_user}","gists_url":"https://api.github.com/users/sandyskies/gists{/gist_id}","starred_url":"https://api.github.com/users/sandyskies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandyskies/subscriptions","organizations_url":"https://api.github.com/users/sandyskies/orgs","repos_url":"https://api.github.com/users/sandyskies/repos","events_url":"https://api.github.com/users/sandyskies/events{/privacy}","received_events_url":"https://api.github.com/users/sandyskies/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/group/distribution","name":"group/distribution","color":"F6FBFF"},{"url":"https://api.github.com/repos/docker/docker/labels/status/1-design-review","name":"status/1-design-review","color":"fef2c0"},{"url":"https://api.github.com/repos/docker/docker/labels/status/failing-ci","name":"status/failing-ci","color":"888888"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-03-06T12:55:50Z","updated_at":"2016-04-19T14:27:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/20987","html_url":"https://github.com/docker/docker/pull/20987","diff_url":"https://github.com/docker/docker/pull/20987.diff","patch_url":"https://github.com/docker/docker/pull/20987.patch"},"body":"fixed [10324](https://github.com/docker/docker/issues/10324)\r\ndocker could't point a network mode when build a image ,in my case, we are unable to use bridge  network mode because my company's restriction. So when I building a docker image , I could't connect to network in container, which is quite annoying. \r\nSo I add --net options for docker build command to use host network mode.\r\nTo verify this feature， create Dockerfile like following:\r\n>From debian:jessie\r\n>RUN /bin/bash -c 'ip addr'\r\n\r\nthen run:\r\n\r\n>docker build --net=host .\r\n\r\nto get the output the make sure use the correct mode\r\n\r\n![image](http://cimg20.163.com/2008/2008/5/22/2008052218514385bad.jpg)\r\nSigned-off-by: sandyskies <chenmingjie0828@163.com>"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/211944853","html_url":"https://github.com/docker/docker/pull/20987#issuecomment-211944853","issue_url":"https://api.github.com/repos/docker/docker/issues/20987","id":211944853,"user":{"login":"sandyskies","id":960434,"avatar_url":"https://avatars.githubusercontent.com/u/960434?v=3","gravatar_id":"","url":"https://api.github.com/users/sandyskies","html_url":"https://github.com/sandyskies","followers_url":"https://api.github.com/users/sandyskies/followers","following_url":"https://api.github.com/users/sandyskies/following{/other_user}","gists_url":"https://api.github.com/users/sandyskies/gists{/gist_id}","starred_url":"https://api.github.com/users/sandyskies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandyskies/subscriptions","organizations_url":"https://api.github.com/users/sandyskies/orgs","repos_url":"https://api.github.com/users/sandyskies/repos","events_url":"https://api.github.com/users/sandyskies/events{/privacy}","received_events_url":"https://api.github.com/users/sandyskies/received_events","type":"User","site_admin":false},"created_at":"2016-04-19T14:27:31Z","updated_at":"2016-04-19T14:27:31Z","body":"@justincormack  As I mentioned ,  routed IP addresses could not be  allocated freely in my company.  \r\n\r\n\r\nIn #10324  \r\njunlian1 mentioned that:\r\n+1 --net=host\r\nAlso, on a cloud vm. run works with --net=host, but I can't build a docker container.\r\n\r\nmichaeljoy  mentioned that:\r\n+1 --net=host\r\n\"docker build\" does not work often times in various permutations of AWS EC2 VPC's as well, while docker run works perfectly fine on 1.8.1. The divergent networking behavior between docker build and docker run needs to be sorted.\r\n\r\nI don't think this is just a coincidence."}}