如果安装了旧版的docker请先卸载:
yum remove docker docker-common docker-selinux dockesr-engine
- yum install -y yum-utils device-mapper-persistent-data lvm2
- yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
- yum install -y docker-ce