docker 拉去镜像资源失败 dial tcp: i/o timeout

docker 拉去镜像资源失败

如下所示:

解决

安装dig工具

yum install bind-utils

查找可用IP

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

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

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

;; ANSWER SECTION:
registry-1.docker.io.	36	IN	A	18.232.227.119
registry-1.docker.io.	36	IN	A	3.218.162.19
registry-1.docker.io.	36	IN	A	23.22.155.84
registry-1.docker.io.	36	IN	A	3.94.35.164
registry-1.docker.io.	36	IN	A	18.213.137.78
registry-1.docker.io.	36	IN	A	3.224.175.179
registry-1.docker.io.	36	IN	A	3.223.220.229
registry-1.docker.io.	36	IN	A	3.211.199.249

;; Query time: 15 msec
;; SERVER: 114.114.114.114#53(114.114.114.114)
;; WHEN: Sat Jun 20 06:13:21 EDT 2020
;; MSG SIZE  rcvd: 177

配置hosts文件

vim /etc/hosts
//编辑结果最终如下所示
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
18.232.227.119  registry-1.docker.io
3.218.162.19  registry-1.docker.io
23.22.155.84   registry-1.docker.io
3.94.35.164  registry-1.docker.io
18.213.137.78  registry-1.docker.io
3.224.175.179  registry-1.docker.io
3.223.220.229  registry-1.docker.io
3.211.199.249  registry-1.docker.io

再次获取镜像资源。

docker pull mysql

posted @ 2020-06-20 18:30  冰柠檬的夏天  阅读(12736)  评论(0编辑  收藏  举报