1.需要将yum repo改成aliyun镜像
cd /etc/yum.repos.d
wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
也可以将这两个repo下载下来直接放入/etc/yum.repos.d目录下
执行yum clean all
yum makecache
执行yum install -y docker
执行完成后修改 /etc/docker/daemon.json
添加"registry-mirrors":["https://v4gms44s.mirror.aliyuncs.com"]
执行systemctl daemon-reload
执行systemctl enable docker
执行systemctl start docker