本文共 560 字,大约阅读时间需要 1 分钟。
[root@node1 ~]# docker pull nginx
Using default tag: latestTrying to pull repository docker.io/library/nginx ... Get : net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)因为在下载官方镜像点的镜像国内访问速度太慢,所以报错,使用加速器就可以解决这个问题
首先打开配置文件daemon.json,centos上安装后有此文件,但是ubuntu上需要自己创建文件:
[root@node1 ~]# vim /etc/docker/daemon.json在文件中加入:{ "registry-mirrors":[""]}然后重启守护进程:
[root@node1 ~]# systemctl daemon-reload[root@node1 ~]#systemctl restart docker可以使用阿里的加速器:
转载于:https://blog.51cto.com/pengjc/2316566