Subject: IPv6 DNS in docker.io/alpine

From: caskd <[email-masked]>
Date: Fri, 16 Jun 2023 10:33:26 +0000

Hello everyone,

i've been trying to pin down where the resolv.conf in the docker image is coming from without success. I've been looking into submitting a request to add IPv6 addresses to the default too to allow containers with IPv6 only connectivity to resolve without deriving a image from the base.

Could you help me pin down where the build scripts/Dockerfile for these are and would adding IPv6 as a fallback cause problems?

-- 
Alex D.
RedXen System & Infrastructure Administration
https://redxen.eu/

---

From: "alice" <[email-masked]>
Date: Sun, 18 Jun 2023 03:08:34 +0200

On Fri Jun 16, 2023 at 12:33 PM CEST, caskd wrote:
> Hello everyone,
>
> i've been trying to pin down where the resolv.conf in the docker image
> is coming from without success. I've been looking into submitting a request
> to add IPv6 addresses to the default too to allow containers with IPv6 only
> connectivity to resolve without deriving a image from the base.
>
> Could you help me pin down where the build scripts/Dockerfile for these are
> and would adding IPv6 as a fallback cause problems?

isn't the resolv.conf in a started container populated on start depending on the
networking configuration?

e.g. with --network=host it just uses your current /etc/resolv.conf. without it,
it depends on how the networking for containers is set up, ...

the actual images are just the unpacked minirootfs, made with mkimg.minirootfs.sh,
but i don't think that touches resolv.conf at all.

---

From: caskd <[email-masked]>
Date: Sun, 18 Jun 2023 09:01:57 +0000

> but i don't think that touches resolv.conf at all.
Indeed. I've started looking deeper and completly missed the upper layer where the actual change happens. This is irrelevant now.

---

From: Kevin Daudt <[email-masked]>
Date: Fri, 16 Jun 2023 12:40:59 +0200

> Could you help me pin down where the build scripts/Dockerfile for these are and would adding IPv6 as a fallback cause problems?

docker itself is responsible for the content of /etc/resolv.conf, so
you should fix it in docker.

You need to add the following to /etc/docker/daemon.json, and restart docker:
  {
    "ipv6": true,
    "fixed-cidr-v6": "<prefix>",
  }

If I don't need a public prefix, I typically use fd80::/80 or something similar.

Hope this helps,
Kevin