例如:
$ docker pull ubuntu:16.04
Trying to pull repository docker.io/library/ubuntu ... 
Get https://registry-1.docker.io/v2/library/ubuntu/manifests/sha256:dd7808d8792c9841d0b460122f1acf0a2dd1f56404f8d1e56298048885e45535: Get https://auth.docker.io/token?scope=repository%3Alibrary%2Fubuntu%3Apull&service=registry.docker.io: read tcp *.*.*.*:41348->50.17.62.194:443: read: connection reset by peer
原因: 目测 50.17.62.194 被 TCP RESET 。
解决方法:
$ dig auth.docker.io
; <<>> DiG 9.10.4-P6-RedHat-9.10.4-4.P6.fc25 <<>> auth.docker.io
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7119
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;auth.docker.io.			IN	A
;; ANSWER SECTION:
auth.docker.io.		60	IN	A	34.193.147.40
auth.docker.io.		60	IN	A	50.17.62.194
auth.docker.io.		60	IN	A	52.5.246.212
;; Query time: 130 msec
;; SERVER: *.*.*.*#53(.*.*.*.*)
;; WHEN: Tue Mar 07 11:03:29 CST 2017
;; MSG SIZE  rcvd: 91
/etc/hosts强制 docker.io 相关的域名解析到其它可用 IP :# /etc/hosts
34.193.147.40 registry-1.docker.io auth.docker.io
|      1joshz      2017-03-07 11:22:58 +08:00 via Android registry 在国内连接总是各种问题,不知道是不是墙在作梗,先 mark 下 | 
|  |      2knightdf      2017-03-07 11:29:27 +08:00 在墙内, 10 次 pull8 次 timeout2 次 reset | 
|      3viila      2017-03-07 12:27:27 +08:00 ss -> polipo -> HTTPS_PROXY or 自建海外 registry 私用 + tag / dns 强制解析 or 国内海量的 registry-mirror ,高校的比如 tuna 或者 ustc ,不过 gcr.io 好像没找到替代的。 | 
|  |      4cloverstd      2017-03-07 12:32:41 +08:00  1 | 
|  |      6Eleutherios      2017-03-07 14:41:32 +08:00 | 
|  |      7gwind      2017-03-07 16:35:32 +08:00 https://www.daocloud.io/mirror 或自己 vps 搭建 docker cache registry |