记录,在使用docker拉取mysql时报错
docker: Error response from daemon: Get “https://registry-1.docker.io/v2/”: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
查询好多文章,我用都不生效,如在docker中配置阿里加速源等
1首先配置resolv.conf文件
vi /etc/resolv.conf
nameserver 8.8.4.4
nameserver 114.114.114.114
systemctl stop firewalld #停用防火墙
2然后配置docker加速源
其他的加速源我用无效,如阿里
{
"registry-mirrors": [
"http://hub-mirror.c.163.com",
"https://mirrors.tuna.tsinghua.edu.cn",
"http://mirrors.sohu.com",
"https://ustc-edu-cn.mirror.aliyuncs.com",
"https://ccr.ccs.tencentyun.com",
"https://docker.m.daocloud.io",
"https://docker.awsl9527.cn"
]
}
3重新加载daemon,启动docker
systemctl daemon-reload
systemctl restart docker
4然后去重新拉取mysql镜像
docker pull mysql:5.7
查看是否有这个镜像
end