安装指定版本的 docker

发布时间: 更新时间: 总字数:210 阅读时间:1m 作者: 分享

安装指定版本的 docker。

yum 源地址

docker 的 rpm 发布在:https://yum.dockerproject.org/repo/main/centos

Index of /repo/main/centos/7/Packages/

...
docker-engine-17.03.0.ce-1.el7.centos.src.rpm                            02-Mar-2017  0:54  21M
docker-engine-17.03.0.ce-1.el7.centos.x86_64.rpm                      02-Mar-2017  0:54  19M
docker-engine-17.03.1.ce-1.el7.centos.src.rpm                            28-Mar-2017  0:19  21M
docker-engine-17.03.1.ce-1.el7.centos.x86_64.rpm                      28-Mar-2017  0:19  19M
docker-engine-17.04.0.ce-1.el7.centos.src.rpm                            05-Apr-2017 23:12  21M
docker-engine-17.04.0.ce-1.el7.centos.x86_64.rpm                      05-Apr-2017 23:12  19M
docker-engine-17.05.0.ce-1.el7.centos.src.rpm                            05-May-2017  5:54  21M
docker-engine-17.05.0.ce-1.el7.centos.x86_64.rpm                      05-May-2017  5:54  20M
...

安装脚本

# 我们以安装docker 17.03.1为例
DOCKER_VERSION=17.03.1

# 下载 docker-engine
wget https://yum.dockerproject.org/repo/main/centos/7/Packages/docker-engine-${DOCKER_VERSION}-1.el7.centos.x86_64.rpm

# 下载 docker-engine-selinux
wget https://yum.dockerproject.org/repo/main/centos/7/Packages/docker-engine-selinux-${DOCKER_VERSION}-1.el7.centos.noarch.rpm

yum install -y libtool-ltdl policycoreutils-python

# 先安装 docker-engine-selinux,再安装 docker-engine-selinux
rpm -ivh docker-engine-selinux-${DOCKER_VERSION}-1.el7.centos.noarch.rpm
rpm -ivh docker-engine-${DOCKER_VERSION}-1.el7.centos.x86_64.rpm

# 下面就可以开启docker服务了
systemctl start docker
systemctl enable docker
Home Archives Categories Tags Docs