1.清除旧版本
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine \
docker-engine-selinux \
docker-selinux
2.安装相关依赖
yum install -y yum-utils device-mapper-persistent-data lvm2
3.配置阿里云地址
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
4.安装docker
yum -y install docker-ce docker-ce-cli containerd.io
5.查看docker版本
docker -v
6.开机自启
systemctl enable docker