1

On a ubuntu 21.10, using docker as a snap (snap install docker). With my firewall enabled, i have a problem resolving DNS:

$ docker run bash ping www.google.com

==> error

$ docker run bash ping 8.8.8.8

==> ok

If I disable the firewall, all is ok (sudo ufw disable):

$ docker run bash ping www.google.com

==> ok

My ufw status is like:

Status: active

To Action From -- ------ ---- 22/tcp ALLOW Anywhere OpenSSH
ALLOW Anywhere Samba
ALLOW 192.168.100.0/24 22/tcp (v6)
ALLOW Anywhere (v6) OpenSSH (v6)
ALLOW Anywhere (v6)

I suspect that the docker container has no access to the internet over TCP (and probably UDP).

What would be the correct config to use to allow docker/snap to pass through the firewall?

jehon
  • 1,404
  • 15
  • 21
  • 1
    I had issues with the snap version of docker not auto-detecting the DNS configuration properly. If you do a `docker run --dns bash ping www.google.com` does it work correctly? In the end I removed that version and installed the .deb version directly from Docker. – jgibson Oct 28 '22 at 21:21
  • 1
    I had trouble with the snap version of docker also - couldn't connect to a TCP port from my container. So did 'snap remove docker', installed from Docker.com, still had probs, so rebooted the machine and now it works. – Brian Burns Nov 27 '22 at 22:05

0 Answers0