Skip to content

Instantly share code, notes, and snippets.

@Malith-Rukshan
Created December 11, 2025 05:56
Show Gist options
  • Select an option

  • Save Malith-Rukshan/571f5c57b7a8558be966451024eadd6c to your computer and use it in GitHub Desktop.

Select an option

Save Malith-Rukshan/571f5c57b7a8558be966451024eadd6c to your computer and use it in GitHub Desktop.
Fix for ghcr.io read: connection reset by peer ipv6 error ✅

⚡ Quick Fix: GHCR IPv6 Connection Reset

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.

📝 The Fix

  1. Locate your hosts file:

    • Linux/macOS: /etc/hosts
    • Windows: C:\Windows\System32\drivers\etc\hosts
  2. 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
  3. Save and re-test your docker pull or podman pull command.

This redirects the traffic to known GitHub IPv4 addresses, bypassing the problematic IPv6 connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment