卸载旧版本
较旧的 Docker版本称为docker或docker-engine 。如果已安装这些程序,请卸载它们以及相关的依赖项
yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
安装依赖包
yum install -y yum-utils device-mapper-persistent-data lvm2
yum list docker-ce.x86_64 --showduplicates | sort -r
yum install -y docker-ce
安装docker-ce
yum install -y --setopt=obsoletes=0 \
docker-ce-17.03.2.ce-1.el7.centos.x86_64 \
docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch
启动Docker服务
systemctl daemon-reload
systemctl restart docker
docker version
docker info