卸载旧版本
systemctl stop docker yum -y remove docker-ce rm -rf /var/lib/docker yum -y remove docker docker-common docker-selinux docker-engine
安装需要的软件包
yum install -y yum-utils device-mapper-persistent-data lvm2
设置stable镜像仓库
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
更新yum软件索引
yum makecache fast
安装Docker-ce
yum -y install docker-ce
启动Docker
systemctl start docker # 开机自启 systemctl enable docker
测试
docker version docker run hello-world