Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.7.0 --net=host doesn't work with bridge=none #14106

Closed
cetex opened this issue Jun 22, 2015 · 7 comments
Closed

1.7.0 --net=host doesn't work with bridge=none #14106

cetex opened this issue Jun 22, 2015 · 7 comments
Assignees
Milestone

Comments

@cetex
Copy link

cetex commented Jun 22, 2015

There's a regression in docker 1.7.0
"docker run --net=host" doesn't work with "docker -d --bridge=none"

We need --bridge=none (as well as --ip-forward=false --ip-masq=false --iptables=false) since we need to be able to push quite a lot of traffic (over 10Gbit/s) to / from the services running in the containers, so docker can't modify host networking at all.

docker version

Client version: 1.7.0
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 0baf609
OS/Arch (client): linux/amd64
Get http:///var/run/docker.sock/v1.19/version: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?

This works:

/usr/bin/docker -d

INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
INFO[0008] [graphdriver] using prior storage driver "btrfs"
WARN[0008] Running modprobe bridge nf_nat failed with message: , error: exit status 1
INFO[0009] Loading containers: start.
............
INFO[0009] Loading containers: done.
INFO[0009] Daemon has completed initialization
INFO[0009] Docker daemon commit=0baf609 execdriver=native-0.2 graphdriver=btrfs version=1.7.0
INFO[0013] POST /v1.19/containers/create
INFO[0013] POST /v1.19/containers/59083f45c267c89c905a42d7ab43e9e05b2432b0afcf699727ef41efae7e9ce0/attach?stderr=1&stdin=1&stdout=1&stream=1
INFO[0013] POST /v1.19/containers/59083f45c267c89c905a42d7ab43e9e05b2432b0afcf699727ef41efae7e9ce0/start
INFO[0013] No non-localhost DNS nameservers are left in resolv.conf. Using default external servers : [nameserver 8.8.8.8 nameserver 8.8.4.4]
INFO[0013] POST /v1.19/containers/59083f45c267c89c905a42d7ab43e9e05b2432b0afcf699727ef41efae7e9ce0/resize?h=24&w=80
INFO[0014] GET /v1.19/containers/59083f45c267c89c905a42d7ab43e9e05b2432b0afcf699727ef41efae7e9ce0/json
^CINFO[0016] Processing signal 'interrupt'

docker run --net host -i -t ubuntu ip addr show

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet 10.255.255.255/32 scope global lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: p2p1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether xx:xx:xx:96:9f:b4 brd ff:ff:ff:ff:ff:ff
3: p2p2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether xx:xx:xx:96:9f:b5 brd ff:ff:ff:ff:ff:ff
4: em1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master lan state UP group default qlen 1000
link/ether xx:xx:xx:ab:c7:50 brd ff:ff:ff:ff:ff:ff
5: em2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master lan state UP group default qlen 1000
link/ether xx:xx:xx:ab:c7:50 brd ff:ff:ff:ff:ff:ff
6: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN group default
link/ether xx:xx:xx:16:ef:b5 brd ff:ff:ff:ff:ff:ff

This doesn't work:

/usr/bin/docker -d --bridge=none

INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)

^Croot@master-s1:~# /usr/bin/docker -d --bridge=none
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
INFO[0006] [graphdriver] using prior storage driver "btrfs"
INFO[0006] Loading containers: start.
..............
INFO[0006] Loading containers: done.
INFO[0006] Daemon has completed initialization
INFO[0006] Docker daemon commit=0baf609 execdriver=native-0.2 graphdriver=btrfs version=1.7.0
INFO[0006] POST /v1.19/containers/create
INFO[0006] POST /v1.19/containers/6ff79398d247dc56d9720547e28d545f3f4fc0cdb5f5cc44aa0210c61d253268/attach?stderr=1&stdin=1&stdout=1&stream=1
INFO[0006] POST /v1.19/containers/6ff79398d247dc56d9720547e28d545f3f4fc0cdb5f5cc44aa0210c61d253268/start
INFO[0006] POST /v1.19/containers/6ff79398d247dc56d9720547e28d545f3f4fc0cdb5f5cc44aa0210c61d253268/resize?h=24&w=80
INFO[0007] GET /v1.19/containers/6ff79398d247dc56d9720547e28d545f3f4fc0cdb5f5cc44aa0210c61d253268/json

docker run --net host -i -t ubuntu ip addr show

1: lo: mtu 65536 qdisc noop state DOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

@GordonTheTurtle
Copy link

Hi!

Please read this important information about creating issues.

If you are reporting a new issue, make sure that we do not have any duplicates already open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead.

If you suspect your issue is a bug, please edit your issue description to include the BUG REPORT INFORMATION shown below. If you fail to provide this information within 7 days, we cannot debug your issue and will close it. We will, however, reopen it if you later provide the information.

This is an automated, informational response.

Thank you.

For more information about reporting issues, see https://github.com/docker/docker/blob/master/CONTRIBUTING.md#reporting-other-issues


BUG REPORT INFORMATION

Use the commands below to provide key information from your environment:

docker version:
docker info:
uname -a:

Provide additional environment details (AWS, VirtualBox, physical, etc.):

List the steps to reproduce the issue:
1.
2.
3.

Describe the results you received:

Describe the results you expected:

Provide additional info you think is important:

----------END REPORT ---------

#ENEEDMOREINFO

@cetex
Copy link
Author

cetex commented Jun 22, 2015

docker info

Containers: 8
Images: 14
Storage Driver: btrfs
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.17.0-031700-generic
Operating System: Ubuntu 14.04 LTS
CPUs: 24
Total Memory: 47.13 GiB
Name: master-s1.r1.xxx
ID: JZWZ:3O5P:IUDG:ESMQ:2ZEF:U6Q4:5IR3:QKGD:ERLZ:RUP5:64AF:KPWR

uname -a

Linux master-s1.r1.xxx 3.17.0-031700-generic #201410060605 SMP Mon Oct 6 10:07:09 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

@tjdett
Copy link
Contributor

tjdett commented Jun 26, 2015

I'm pretty sure this affects CoreOS 723.0.0 (coreos/manifest@a197f13) as it uses --bridge=none for early-docker.service and --net=host for flanneld.service.

@mavenugo mavenugo added this to the 1.7.1 milestone Jun 26, 2015
tjdett added a commit to dit4c/docker that referenced this issue Jun 29, 2015
Signed-off-by: Tim Dettrick <t.dettrick@uq.edu.au>
tjdett added a commit to dit4c/docker that referenced this issue Jun 29, 2015
Signed-off-by: Tim Dettrick <t.dettrick@uq.edu.au>
@tjdett
Copy link
Contributor

tjdett commented Jun 29, 2015

I've modified a couple of tests to detect this bug:
https://github.com/dit4c/docker/tree/14106-bug-detection

The bad behaviour only occurs with --bridge=none, which is how it was probably missed.

I ported the tests back to 1.6.2, and they pass:
https://github.com/dit4c/docker/tree/14106-bug-detection-1.6.2

@mavenugo
Copy link
Contributor

@cetex @tjdett I have identified the issue and am working on a proper solution.
This is a classic case of incorrect variable names and code assumptions leading to incorrect behavior.
Also, there are some inherent assumptions on what bridge=none really means ?

Will push PR shortly that will address this issue.

@cetex
Copy link
Author

cetex commented Jun 29, 2015

I assume bridge=none means that docker won't use a bridge and won't try to setup a bridge. This combined with all the other options we use should mean that docker won't try to do anything "automagically" at all when it comes to networking. and if we want networking in a container we need to specify "--net=host". :)

@calavera
Copy link
Contributor

This is already in master and will be released in 1.7.1 as part of #14264.

Closing, thanks for reporting this issue! 🤘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants