先卸载一波
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine
安装依赖
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
添加源
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum makecache fast
安装
yum install docker-ce
开机启动
systemctl enable docker
systemctl start docker