先看文档:https://docs.docker.com/engine/installation/linux/docker-ce/centos/
1. sudo yum remove docker
docker-common
docker-selinux
docker-engine
2.
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
3.
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
4.
yum list docker-ce --showduplicates | sort -r
sudo yum install docker-ce