yum remove docker docker-common docker-selinux docker-engine -y
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
yum update -y
wget -O /etc/yum.repos.d/docker-ce.repo https://repo.huaweicloud.com/docker-ce/linux/centos/docker-ce.repo
# 清除rpm包及header
yum clean all
# 重新缓存远端服务器rpm包信息
yum makecache
mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://qi3pe2qe.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload
yum install docker-ce -y
[root@docker01 ~]# systemctl start docker
[root@docker01 ~]# systemctl enable docker
[root@docker01 ~]# docker info
[root@docker01 ~]# docker version