Follow the steps
1、安装依赖
yum install -y yum-utils device-mapper-persistentdata lvm2
2、配置国内yum源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3、查看版本
yum list docker-ce --showduplicates | sort -r
4、安装docker
yum -y install docker-ce-20.10.10-3.el7
5、查看版本
docker -v
6、检查docker安装结果
docker info
7、启动docker
systemctl start docker
8、查看docker状态
systemctl status docker
9、修改docker镜像仓库
vim /etc/docker/daemon.json
daemon.json文件内容为:
{
"debug":true,
"experimental":true,
"registry-mirrors":["https://pb5bklzr.mirror.aliyuncs.com","https://hub-mirror.c.163.com","https://docker.mirrors.ustc.edu.cn"]
}
10、重启docker
systemctl restart docker
11、查看是否配置成功
docker info