在centos6.9和centos7.4测试成功!
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
# centos 6.x
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
# centos 7.x
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# 生成缓存
yum makecache
yum install epel-release -y
yum -y install docker-io
service docker start
docker version
centos6.9安装版本1.7.1
centos7.4安装版本1.12.6
官方安装教程:https://docs.docker.com/install/linux/docker-ce/centos/
# 更新yum包
yum update -y
curl -fsSL https://get.docker.com/ | sh
systemctl enable docker
service docker start
docker version
安装的最新社区版