Yum 安装Docker
1.安装依赖包
yum install -y yum-utils device-mapper-persistent-data lvm2
2.添加Docker 软件的包源
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
或者使用阿里源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3.安装Docker CE
yum install -y docker-ce
4.启动Docker 服务并设置开机启动
systemctl start docker
systemctl enable docker