Loading

阿里云Docker加速镜像配置

在CentOS上面安装Docker

检查自己的环境有没有装过Docker:docker h
修改root权限:sudo su
直接安装:yum install docker-io

这个时候可能会提示:No match for argument: docker-io

解决方法:登陆阿里云后台--实例与镜像--实例,选择实例停止,然后点更多选择磁盘和镜像--更换操作系统,换到之前的centos版本,我换的是7.2

再次安装成功

使用Docker安装Mysql

拉取Mysql镜像:docker pull mysql:5.7.22

报错信息

Trying to pull repository docker.io/library/mysql ... Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

 

 错误原因:镜像源为国外镜像
修改daemon.json文件

"registry-mirrors": ["https://registry.docker-cn.com","https://pee6w651.mirror.aliyuncs.com"]

重启Docker:systemctl restart docker

发现还是不行

登录阿里云获取镜像加速器,查看加速情况:https://cr.console.aliyun.com/cn-zhangjiakou/instances/mirrors

 

posted @ 2021-04-02 14:18  Haaai  阅读(120)  评论(0编辑  收藏  举报