解决报错Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: TLS handshaketimeout
解决docker拉取镜像时的报错:
[root@zlhost docker-file]# docker pull java-8
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/library/java-8/manifests/latest:
Get https://auth.docker.io/token?scope=repository%3Alibrary%2Fjava-8%3Apull&service=
registry.docker.io: net/http: request canceled while waiting for connection
(Client.Timeout exceeded while awaiting headers)
该错误是连接不到网络,需要在本地配置hosts地址
- 通过dig @114.114.114.114 registry-1.docker.io找到可用IP地址
IP地址非固定可能会变动,所以需要多试几次(几个IP)
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;registry-1.