昨天刚刚配置好虚拟机上的docker,docker可以成功的将镜像上传到阿里云,但今天就始终不行,报下面的错误:
Error response from daemon: Get https://registry.cn-hangzhou.aliyuncs.com/v2/: Get https://dockerauth.cn-hangzhou.aliyuncs.com/auth?account=ppmicro&client_id=docker&offline_token=true&service=registry.aliyuncs.com%3Acn-hangzhou%3A26842: dial tcp: lookup dockerauth.cn-hangzhou.aliyuncs.com on 61.139.2.69:53: dial tcp 61.139.2.69:53: i/o timeout
The push refers to repository [registry.cn-hangzhou.aliyuncs.com/ppmicro/exam]
e776ab8d046e: Retrying in 2 seconds
a78b79a93bab: Preparing
ceaf9e1ebef5: Preparing
9b9b7f3d56a0: Preparing
f1b5933fe4b5: Preparing
网上查找了一下,配置insecure-registries不行。
[root@147 appbuild]# cat /etc/docker/daemon.json
{ "insecure-registries":["registry.cn-hangzhou.aliyuncs.com"]
再试验在daemon.json中配置dns为8.8.8.8,也不行。
最后
vim /etc/resolv.conf
将dns修改为8.8.8.8 才可以。
# Generated by NetworkManager
nameserver 8.8.8.8