I have been running a bunch of containers for over a year alongside UFW on my system (which has docker and non-docker services running on it.)
Some of my containers are using regular docker, some are using docker-compose. I have not had any networking issues before.
Out of nowhere my containers no longer have internet access if UFW is enabled. With UFW disabled, all my alpine based can run apk update
and it connects to the repos successfully and updates. On my python containers (based on Debian) I run apt-get update
it says temporary failure in name resolution. It attempts to access deb.debian.org or by the domain name and the IP address, both fail.
On all my containers /etc/resolv.conf
reads:
nameserver 127.0.0.11
options ndots: 0
I use a pihole on my network at IP 10.64.187.1
as the DNS server for this computer. The host’s /etc/resolv.conf
reads:
nameserver 10.64.187.1
nameserver 127.0.0.53
The host can update it’s own packages. The host OS is Bodhi Linux (Based on Ubuntu 20) and docker is version: Docker version 20.10.24, build 297e128 installed via snap.
I tried running sudo wg-quick down wg0
to disconnect from the pihole, which changes the /etc/resolv.conf
to:
nameserver 127.0.0.53
The host can still update repos but these Debian based containers cannot.
Here are a few things I have tried.
Installed ufw-docker and set up the rules – changed nothing
Ran sudo snap remove docker --purge
and then sudo snap install docker
Ran the following:
sudo pkill docker
sudo iptables -t nat -F
sudo ifconfig docker0 down
sudo brctl delbr docker0
sudo snap restart docker
I have documented a lot of other information in this reddit post and the comments
Please help me to troubleshoot and pinpoint the issue here because I have a project that requires internet access that I have been developing for 6 months and it’s development has been put on hold until this is solved.
I have included my compose.yaml and Dockerfiles here: pastebin .com/qxU5vUGC