If you see ghcr.io read: connection reset by peer ipv6 when pulling from GitHub Container Registry, your system might be failing on IPv6.
The fix is to force IPv4 by editing your local hosts file.
-
Locate your
hostsfile:- Linux/macOS:
/etc/hosts - Windows:
C:\Windows\System32\drivers\etc\hosts
- Linux/macOS:
-
Add these entries to the bottom of the file (requires administrator/sudo rights):
# Force IPv4 for GitHub Container Registry 140.82.121.34 ghcr.io 185.199.108.154 pkg-containers.githubusercontent.com
-
Save and re-test your
docker pullorpodman pullcommand.
This redirects the traffic to known GitHub IPv4 addresses, bypassing the problematic IPv6 connection.