1、注册并登入阿里云镜像中心
地址:https://cr.console.aliyun.com/
2、点击左侧"镜像中心-镜像加速器",复制加速器地址
形如:https://abcdefg.mirror.aliyuncs.com
图片描述
3、打开镜像配置文件
sudo vi /etc/docker/daemon.json
3、编辑文件,配置加速地址
{
"registry-mirrors": ["https://abcdefg.mirror.aliyuncs.com"]
}
4、重新加载配置文件
sudo systemctl daemon-reload
5、重启docker
sudo systemctl restart docker