I am facing this issue and I can find many people also facing this same issue mainly because of DNS and or Proxy.
But in my case, I don't have proxy, and I confirm the DNS is working well.
systemctl disable firewalld ; systemctl stop firewalld ; systemctl disable iptables ; systemctl stop iptables ; iptables -F ; iptables -nL
[root@ ~]# systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
[root@ ~]# systemctl status iptables
Unit iptables.service could not be found.
[root@ ~]#
[root@ ~]# docker pull hello-world
Using default tag: latest
Trying to pull repository docker.io/library/hello-world ...
Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
[root@ ~]# # nslookup registry-1.docker.io
Server: 1.1.1.1
Address: 1.1.1.1#53
Non-authoritative answer:
Name: registry-1.docker.io
Address: 107.23.149.57
Name: registry-1.docker.io
Address: 52.5.11.128
Name: registry-1.docker.io
Address: 52.54.232.21
Name: registry-1.docker.io
Address: 54.85.107.53
Name: registry-1.docker.io
Address: 52.1.121.53
Name: registry-1.docker.io
Address: 18.232.227.119
Name: registry-1.docker.io
Address: 18.213.137.78
Name: registry-1.docker.io
Address: 52.4.20.24
This issue can be always reproduced anytime:
- Install a fresh Centos 7.7 or 7.8 (do yum update or even without)
- on if-cfg, add DNS1 & DNS2 = <any public dns such as 1.1.1.1, 8.8.8.8>
- Install Docker 1.13.1 (yum install docker (docker.x86_64 2:1.13.1-162.git64e9980.el7.centos))
- Start Docker (systemctl start docker)
- Disable firewalld and iptables
- Pull any docker image (docker pull hello-world)
- Error as above
Tried with Docker-CE and no issue at all:
- Remove above docker (yum -y remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine)
- Install Docker-CE (yum install -y yum-utils; yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo; yum -y install docker-ce docker-ce-cli containerd.io)
- Start Docker (systemctl start docker)
- Pull any docker image (docker pull hello-world)
- Image pulled successfully
- <test uninstall docker-ce again, then install docker (1.13.1) again, then having the same error again>
I need this Docker 1.13.1 because it's the dependency of python-tripleoclient which I am trying to test this.
Does anyone also encounter this issue? Or perhaps did I miss something?