Centos安装Docker特定版本

某些情况下,不希望安装官方最新版本,这个时候就需要指定版本进行安装

1. 前置条件
必须是CENTOS7,64位
2. 安装源
sudo tee /etc/yum.repos.d/docker.repo
<<-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF
3. 选择版本号

进入

https://yum.dockerproject.org/repo/main/centos/7/Packages/

选择需要安装的版本号,如:

docker-engine-1.12.4-1.el7.centos.src.rpm
docker-engine-1.12.4-1.el7.centos.x86_64.rpm
docker-engine-1.12.5-1.el7.centos.src.rpm
docker-engine-1.12.5-1.el7.centos.x86_64.rpm

4. 安装依赖包

docker-engine依赖docker-engine-selinux包,先安装相同版本的docker-engine-selinux包:

yum install docker-engine-selinux-1.12.5-1.el7.centos.noarch.rpm

5. 安装Docker

yum install docker-engine-1.12.5-1.el7.centos.x86_64.rpm

6. 启动Docker
sudo systemctl start docker
7. 测试Docker
sudo docker run hello-world

Leave a Reply

Your email address will not be published. Required fields are marked *