Using default tag: latest
Trying to pull repository docker.io/library/centos ...
Get https://registry-1.docker.io/v2/library/centos/manifests/latest: net/http: TLS handshake timeout

解决方法

  1. 通过命令查询可用的解析IP

    dig @114.114.114.114 registry-1.docker.io
    
    工具需要安装一个命令dig
    yum install bind-utils   
    
    其它版本安装方式:
    在Gentoo下是bind-tools,在Redhat/Fedora下是 bind-utils,或者在   Debian下是 dnsutils。        

    [root@tomcat8 ~]# dig @114.114.114.114 registry-1.docker.io

    ; <<>> DiG 9.9.4-RedHat-9.9.4-72.el7 <<>> @114.114.114.114 registry-1.docker.io
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58485
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 8, AUTHORITY: 0, ADDITIONAL: 1

    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ;; QUESTION SECTION:
    ;registry-1.docker.io. IN A

    ;; ANSWER SECTION:
    registry-1.docker.io. 30 IN A 34.205.207.96
    registry-1.docker.io. 30 IN A 34.201.236.93
    registry-1.docker.io. 30 IN A 54.175.43.85
    registry-1.docker.io. 30 IN A 34.200.28.105
    registry-1.docker.io. 30 IN A 52.70.175.131
    registry-1.docker.io. 30 IN A 52.54.155.177
    registry-1.docker.io. 30 IN A 34.206.236.31
    registry-1.docker.io. 30 IN A 54.165.149.19

    1. 修改hosts记录文件

      vi /etc/hosts
      52.54.155.177 registry-1.docker.io

    2. docker pull centos

      [root@tomcat8 ~]# docker pull centos
      Using default tag: latest
      Trying to pull repository docker.io/library/centos ...
      latest: Pulling from docker.io/library/centos
      a02a4930cb5d: Downloading [=======> ] 11.8 MB/75.17 MB