CentOS7下修改docker镜像源(解决TSL timeout问题)

问题是这样的:

4e1bafcdbc6f: Waiting
bafbeb6b464b: Waiting
c0e0660d6638: Waiting
269e6f7314e4: Waiting
05fd6d8029a7: Waiting
0aab41d51f2d: Waiting
error pulling image configuration: Get https://dseasb33srnrn.cloudfront.net/registry-v2/docker/registry/v2/blobs/sha256/7b/7b60c3ede539c6cbf7cea63c0369ed47cbe52f055965316a8f7647fea7f280ce/data?Expires=1521568648&Signature=D6AutC~coxbkLdr92I~~pnyJVKQPgMDQetej5nsg7dyH4zHy61imihF-aO8php4ym3BGwuJsRQY8~a6hU6HccfoZd2iJ52bPMgk8XHAt5GKc1XDfbBTJVvPppmQnrwcNZ7uWA4-1ghVGVmm~b1KzzskyXAOqVffo74H20lfA7og_&Key-Pair-Id=APKAJECH5M7VWIS5YZ6Q: net/http: TLS handshake timeout

某zf的墙实在太厉害了,这里分享一下修改源的方法

daocloud似乎用不了了?不过好在官方给出了中国用户的解决方案。
注意每个系统修改配置的位置不同,这里给出centos7的配置方案:

修改 /etc/docker/daemon.json 文件并添加上 registry-mirrors 键值

{  
    "registry-mirrors": ["https://registry.docker-cn.com"]
}

注意json格式不要写错了,可以用json校验器校验一下,否则不能用

重启docker: sudo service docker restart

OK,可以了,效果如下:

Using default tag: latest
latest: Pulling from ufoym/deepo
22dc81ace0ea: Pull complete
1a8b3c87dba3: Pull complete
91390a1c435a: Pull complete
07844b14977e: Pull complete
b78396653dae: Pull complete
72d8a32a6330: Pull complete
4e1bafcdbc6f: Pull complete
bafbeb6b464b: Pull complete
c0e0660d6638: Pull complete
269e6f7314e4: Pull complete
05fd6d8029a7: Pull complete
0aab41d51f2d: Downloading 1.219GB/2.389GB

可以正常的pull了

你可能感兴趣的:(运维)