百度&必应权4, 日IP8000. 查看详情
自助收录

Docker安装MySQL报“408 Request Time-out”

开发环境11个月前更新 孤城孤刀
575 0 0

Docker安装MySQL报“408 Request Time-out”

问题现象:

Docker容器安装完成后安装mysql,拉取mysql镜像时报“408 Request Time-out”

详细信息:

[root@localhost /]# docker pull mysql:5.7
Error response from daemon: error parsing HTTP 408 response body: invalid character ‘<‘ looking for beginning of value: “<html><body><h1>408 Request Time-out</h1>\nYour browser didn’t send a complete request in time.\n</body></html>\n”

Docker安装MySQL报“408 Request Time-out”

解决办法:

1、检查网络连接是否正常,尝试ping一个常见的网址,比如:ping www.baidu.com

Docker安装MySQL报“408 Request Time-out”

2、检查Docker状态是否正常:systemctl status docker,如果未启动,请先启动后重试,启动命令:systemctl start docker

Docker安装MySQL报“408 Request Time-out”

3、检查Docker镜像源是否正确
1)镜像源位置:/etc/docker/daemon.json,如果该目录下没有daemon.json这个文件请手动创建
2)将以下镜像源添加到上面的文件中
{
“registry-mirrors”: [“http://hub-mirror.c.163.com”, “https://registry.docker-cn.com”]
}
3)也可以配置其他国内的镜像源:
阿里云:https://pee6w651.mirror.aliyuncs.com
网易:http://hub-mirror.c.163.com
中国科技大学:https://docker.mirrors.ustc.edu.cn

4、加载配置文件
systemctl daemon-reload

5、重启Docker服务
systemctl restart docker

6、重新拉取mysql镜像
[root@localhost ~]# docker pull mysql:5.7
5.7: Pulling from library/mysql
20e4dcae4c69: Pull complete
……
df9a4d85569b: Pull complete
Digest: sha256:4bc6bc963e6d8443453676cae56536f4b8156d78bae03c0145cbe47c2aad73bb
Status: Downloaded newer image for mysql:5.7
docker.io/library/mysql:5.7

7、验证是否拉取成功
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mysql 5.7 5107333e08a8 3 weeks ago 501MB

© 版权声明

相关文章

暂无评论

暂无评论...