安装docker
1.更新yum包
yum update
2.卸载旧版本
yum remove docker
3.安装依赖
yum install -y yum-utils device-mapper-persistent-data lvm2
4.设置yum源
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
5.安装docker
yum install docker-ce
6.启动docker
systemctl start docker
systemctl enable docker //加入开机自启
7.验证安装是否成功
docker version