安装依赖
yum install -y yum-utils device-mapper-persistent-data lvm2
安装 yum 源
yum-config-manager --add-repo http://download.docker.com/linux/centos/docker-ce.repo
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
安装 docker
yum -y install docker-ce
设置自启动
systemctl start docker
systemctl enable docker