Docker Hub pulls failing due to IPv6 DNS
While on Ubuntu servers, image pulls from Docker Hub kept failing with the following error: Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp [2600:1f18:2148:bc00:c80c:3676:30dd:a616]:443: connect: cannot assign requested address Running ip addr show confirmed the host has no IPv6 addresses on any interface. The server’s network does not route IPv6. The culprit is Docker’s Go runtime. Unlike most system programs, Docker does not use the C library’s getaddrinfo() for DNS - it has its own pure Go resolver. When DNS returns both A and AAAA records for registry-1.docker.io, Go prefers the IPv6 address. The kernel immediately returns EADDRNOTAVAIL because there is no IPv6 source address to bind, and the connection fails before any packet reaches the network. ...