Docker networking only works with --net=host

waf*_*ffl 6 networking docker

Edit: I've managed to realize that the issue is with bridge networking, as network functionality seems fine with --net=host.

docker run -it --net=host busybox ping -c 1 8.8.8.8 works consistently.

Looking at this thread on reddit Docker network problem. Only works with --net=host the OP's issue was resolved by uninstalling ebtables. I've done the same but still have the same problem.

--

I've read through numerous threads (see below) trying to get to the bottom of an issue I'm having installing Discourse through a docker instance which fails when it tries to pull from github. Most threads point to issues in DNS, but I realized it's something else as I can't ping a static IP address either.

The discourse install fails with: cd /pups && git pull && /pups/bin/pups --stdin fatal: unable to access 'https://github.com/discourse/pups.git/': Could not resolve host: github.com

The oddest thing is that it works immediately after a restart:

systemctl restart docker

docker run -it busybox ping -c 1 8.8.8.8

PING 8.8.8.8 (8.8.8.8): 56 data bytes 64 bytes from 8.8.8.8: seq=0 ttl=58 time=0.646 ms

--- 8.8.8.8 ping statistics --- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max = 0.646/0.646/0.646 ms

docker run -it busybox ping -c 1 8.8.8.8

PING 8.8.8.8 (8.8.8.8): 56 data bytes

--- 8.8.8.8 ping statistics --- 1 packets transmitted, 0 packets received, 100% packet loss

No matter what, the subsequent call fails. I'm confused how to go about debugging this.

Distributor ID: Ubuntu
Description:    Ubuntu 18.04.2 LTS
Release:        18.04
Codename:       bionic
Docker version 18.09.5, build e8ff056 (released 2019-04-11)
Run Code Online (Sandbox Code Playgroud)

Attempted fixes:

waf*_*ffl 1

我们的 IT 部门最终将其确定为 Ubuntu 18.x 中 IPv6 的某种问题,以某种方式连接到此 systemd 问题udevd: 无法为 $name 生成持久 MAC 地址: 没有这样的文件或目录 #3374并且存在于systemd version 247, for Ubuntu 18.x 没有更新

最后,将发行版更新到 20.x 解决了我们的问题。