hongblue 发表于 2019-2-20 11:06:17

Docker 获取容器镜像报错

Dokcer 获取容器镜像报错
  # docker pull nginx
Using default tag: latest
Trying to pull repository docker.io/library/nginx ...
Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
  因为在下载官方镜像点的镜像国内访问速度太慢,所以报错,使用加速器就可以解决这个问题
  首先打开配置文件daemon.json,centos上安装后有此文件,但是ubuntu上需要自己创建文件:
# vim /etc/docker/daemon.json
在文件中加入:
{
"registry-mirrors":["https://docker.mirrors.ustc.edu.cn"]
}
  然后重启守护进程:
# systemctl daemon-reload
#systemctl restart docker
  可以使用阿里的加速器:https://yq.aliyun.com/articles/29941



页: [1]
查看完整版本: Docker 获取容器镜像报错