Closed mbunkus closed 4 weeks ago
I believe the container is setup to support ipv4 only, in general docker does not work well with ip6.
The container has no problem with IPv6, or rather, with outgoing IPv6:
[0 root@durnik /srv/docker-compose/yacht] docker exec -ti yacht /bin/bash
root@23d4d0143f51:/api# ping -6 www.google.com
PING www.google.com (2a00:1450:4001:802::2004): 56 data bytes
64 bytes from 2a00:1450:4001:802::2004: seq=0 ttl=116 time=5.407 ms
64 bytes from 2a00:1450:4001:802::2004: seq=1 ttl=116 time=5.852 ms
^C
--- www.google.com ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 5.407/5.629/5.852 ms
root@23d4d0143f51:/api#
I'm well aware of Docker's sub-par IPv6 support. Having images support IPv6 would be a great step in improving the situation overall, especially given that there are other orchestrators out there that use the same images. For example Kubernetes has proper IPv6 support now (or is pretty close to having it). And yes, I'm also aware that Kubernetes isn't a great argument in the context of Yacht :grin:
Anyway, in the case of Yacht "proper IPv6" support would probably mean nothing more than making the daemon listen on IPv6, too. In terms of sockets this means listening on ::
instead of 0.0.0.0
, or if the port number is part of the listen spec, on [::]:8000
instead of 0.0.0.0:8000
. The reason is that at least on Linux listening on the IPv6 wildcard address will automatically listen on IPv4, too.
If you're worried about that, you can also try listening on both [::]:8000
and 0.0.0.0:8000
, in that order, and ignore failures if exactly one of those fails:
[::]:8000
succeeds & turns on listening on IPv4 as well, then 0.0.0.0:8000
will fail; the daemon will now listen on both IPv6 & IPv4[::]:8000
succeeds & but doesn't turn on listening on IPv4 as well, then 0.0.0.0:8000
will also succeed, and the daemon will now listen on both IPv6 & IPv4[::]:8000
fails due to IPv6 being completely turned off on the host but listening on 0.0.0.0:8000
succeeds, then the daemon will only listen on IPv4, and that'd be OK for those hostsAs a last resort one might make the address/port number to listen on configurable via environment variables. Other images go that route.
As an example for Docker images that support listening on IPv6 out of the box (or where I could configure it via an environment variable): Authentik; Wekan; PowerDNS Admin; Docker Registry; Portainer.
Describe the bug The daemon only listens on IPv4, even if the Docker container has IPv6 enabled & working.
To Reproduce Steps to reproduce the behavior:
docker-compose.yml
file to enable IPv6 for the network (see below)docker compose up
docker compose inspect …
to determine IPv4 & IPv6 addressesActual IPv6 obscured.
Expected behavior The daemon should listen on both IPv4 & IPv6.
Desktop (please complete the following information):
Additional context
Contents of
docker-compose.yml
:Again, actual IPv6 subnet obscured.
Logs