Request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

I use:

  • Docker with WSL (Docker version 24.0.5, build 24.0.5-0ubuntu1~20.04.1)
  • Windows 10

While docker login I got an error

login registry-1.docker.io/v2/
Username: xxx
Password:
INFO[0067] Error logging in to endpoint, trying next endpoint  error="Get \"https://registry-1.docker.io/v2/\": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)


I changed /etc/resolv.conf

cat /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4

added Environment="NO_PROXY=localhost,127.0.0.1" in /etc/systemd/docker.service.d/http-proxy.conf
But I still have the same error…
Could you please give me some hints to fix the problem?