使用yum方式安装
1、安装依赖包
yum install -y yum-utils device-mapper-persistent-data lvm2
2、设置稳定版仓库
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
3、安装
//安装最新版本
yum install docker-ce
4、启动doker
systemctl start docker
5、通过运行hello-world镜像验证安装是否成功
docker run hello-world