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)
Attempted fixes: