This issue has been driving my crazy for quite some time now, and I’ve been pulling my hair out trying to get to the bottom of it, so any help would be greatly appreciated.
- Docker for mac (4.4.2, but have seen the issue across many versions)
- Using docker-compose to run the containers locally (no additional networking or DNS settings in the compose file))
- Using Mac with intel chip
When a container is newly created, all networking will work as expected; it can ping out to the internet, and connect to our external services (AWS, a remote-hosted database & cache).
However, after a few minutes all outgoing connections on the container will fail, and never recover for the life of the container (occasionally it will recover for a few seconds, but ultimately no new connections can be made).
For example, trying to ping an outside address from the container:
root@92cddcdcd645:/app# ping google.com PING google.com (18.104.22.168) 56(84) bytes of data. From 172.25.0.1 (172.25.0.1) icmp_seq=35 Destination Host Unreachable From 172.25.0.1 (172.25.0.1) icmp_seq=36 Destination Host Unreachable From 172.25.0.1 (172.25.0.1) icmp_seq=44 Destination Host Unreachable
Running the docker diagnostics also points to an issue connecting to the internet:
$ /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check ... [FAIL] DD0012: is the VM networking working? network checks failed: failed to ping host: exit status 1
Things I’ve tried:
- Disabling VPN
- Removing anti-virus software (Sophos)
This issue has been going on for almost 2 months now (don’t know what really started it), but have read countless articles about issues related to docker-networking, and nothing has really pointed to a solutions.
I feel like I’ve sort of exhausted all my options at this point for figuring out what is happening here. I also don’t have too much experience with low-level networking, so open to any suggestions for ways to debug what might be going on (any logs or things to look at that might give more details?)
Also happy to provide any more details that might be useful.