yum -y install yum-utils device-mapper-persistent-data lvm2

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

yum makacache fast
yum -y install docker-ce


systemctl start docker #启动docker服务
systemctl enable docker #设置docker为开机启动

docker run hello-world

安装成功!
原文:https://www.cnblogs.com/wind-ranger/p/14660549.html