Score:0

Docker containers can't resolve host on Ubuntu

ar flag

I have installed Ubuntu server with the latest patches, and I switched to AT+T, and I suddenly was unable to resolve external sites from inside of a Docker container.

How to resolve this?

I noticed that AT+T switched to using ipv6 by default when I did a simple ping:

 $ ping debian.org

PING debian.org(mirror-csail.debian.org (2603:400a:ffff:bb8::801f:3e)) 56 data bytes

This is pretty cool, but my Docker containers are now broken regarding networking.

Score:1
ar flag

I found that the ipv6 hunch seemed to be correct. By turning on ipv6 for Docker, I was able to get networking inside of Docker containers again.

https://medium.com/@skleeschulte/how-to-enable-ipv6-for-docker-containers-on-ubuntu-18-04-c68394a219a2

First modify /etc/docker/daemon.json:

{ 
        "ipv6": true,
        "fixed-cidr-v6": "fd00::/80"
}

Next set up routing:

ip6tables -t nat -A POSTROUTING -s fd00::/80 ! -o docker0 -j MASQUERADE

Note, you need to persist this as it will not survive reboot:

Iptables reload/restart on Ubuntu 18.04

Next restart docker:

 $ systemctl restart docker

Now your Docker containers should have ipv6 again.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.