1.安装相关依赖
yum install -y yum-utils device-mapper-persistent-data lvm2
2.配置国内源
sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3.安装docker
sudo yum -y install docker-ce
4.启动&设置开机启动
systemctl enable docker
systemctl start docker
5.配置镜像加速/etc/docker/daemon.json
cd /etc/docker/
touch daemon.json
{
"registry-mirrors": ["https://registry.docker-cn.com"]
}