重装docker步骤
环境
centos7.1
core3.10
docker17.05-ce
目标
安装docker1.12.4版本
解决步骤
1.删除
rpm -qa|grep docker(查看安装了哪些docker组件)
rpm -qa|grep docker|xargs yum remove -y(确认上一步的结果都是可以删除的后,执行删除操作)
2.重装
2.1.下载rpm包安装
DOCKER_VERSION=1.12.4(设置要修改到的docker版本号,设置在环境变量中)
wget https://yum.dockerproject.org/repo/main/centos/7/Packages/docker-engine-${DOCKER_VERSION}-1.el7.centos.x86_64.rpm (下载安装的rpm包)
wget https://yum.dockerproject.org/repo/main/centos/7/Packages/docker-engine-selinux-${DOCKER_VERSION}-1.el7.centos.noarch.rpm (下载安装的rpm包)
rpm -ivh docker-engine-selinux-${DOCKER_VERSION}-1.el7.centos.noarch.rpm (先安装selinux包)
rpm -ivh docker-engine-${DOCKER_VERSION}-1.el7.centos.x86_64.rpm (再安装docker-engine包)
2.2.在线yum直接安装
yum install docker-engine-1.12.6*
3.重启
systemctl start docker (启动docker服务)
systemctl enable docker (设置docker服务自启动)
验证
docker -v
Docker version 1.12.4, build 1564f02