I'm running a Debian container on my Manjaro host. Until recently, apt update worked fine, but now it only works if I set the network mode to host. Otherwise, the command hangs at "Connecting to deb.debian.org".
Works with --network=host:
docker run --rm -it --network=host debian bash
root@container:/# apt update
Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
Reading package lists... Done
Fails (default bridge network):
docker run --rm -it debian bash
root@container:/# apt update
0% [Connecting to deb.debian.org] # Hangs indefinitely
What I've tried:
Restarting Docker (
sudo systemctl restart docker)Checking
iptablesrules (sudo iptables -L -v -n)Checking DNS inside the container (
cat /etc/resolv.conf→ it usesnameserver 127.0.0.11)Testing network connectivity inside the container:
ping 8.8.8.8 # Hangs nslookup google.com # FailsI followed this Stack Overflow thread, but the suggested solutions (such as setting
--dns 8.8.8.8or modifyingiptables) did not resolve the issue.