skip to Main Content

I got the following error inside my gitlab runner:

ERROR: failed to authorize: failed to fetch anonymous token: Get "https://auth.ipv6.docker.com/token?scope=repository%3Alibrary%2Fnode%3Apull&service=registry.docker.io": dial tcp [2600:1f18:2148:bc02:4bf0:3a98:55ae:e3d5]:443: connect: cannot assign requested address

see: https://docs.docker.com/registry/spec/auth/token/

Is there a way to change auth.ipv6.docker.com with auth.ipv4.docker.com somewhere ?

2

Answers


  1. This seems to be related to the recent (as of 2023-08-24) changes on the Docker registry enabling IPv6 globally.
    https://www.docker.com/blog/docker-hub-registry-ipv6-support-now-generally-available/

    There may be something specific with the infrastructure, as several users declare using servers hosted by Hetzner.

    From what I could gather from this Github issue, you can either:

    Enable IPv6

    Change /etc/docker/daemon.json, according to the Docker documentation.
    For example:

    {
      "ipv6": true,
      "fixed-cidr-v6": "2001:db8:1::/64",
      "experimental": true,
      "ip6tables": true
    }
    

    Or,

    Force the IPv4 registry domain

    Add this to /etc/docker/daemon.json:

    {
      "registry-mirrors": ["https://registry.ipv4.docker.com"]
    }
    

    Don’t forget to restart the daemon.

    sudo systemctl restart docker
    

    We had the same issue on our Gitlab CI, also hosted on Hetzner. We went with the latter, pending a more robust solution.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search