I tried completely disabling IPv6 on the Pi.
after running sudo docker run hello-world
I get
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/library/hello-world/manifests/sha256:d000bc569937abbe195e20322a0bde6b2922d805332fd6d8a68b19f524b7d21d": dial tcp [2600:1f18:2148:bc01:571f:e759:a87a:2961]:443: socket: address family not supported by protocol.
See 'docker run --help'.```
I’m actually not sure what is needed exactly to always get IPv4 addresses from the DNS servers, but as workaround, you can run nslookup registry-1.docker.io and choose an IPv4 address and add it to your hosts file. (/etc/hosts on Linux and macOS)