CentOS7安装特定版本的Docker

时间:2022-03-15 05:50:20

查询可用版本

[root@bogon ~]# yum list docker-ce --showduplicates | sort -r

查询结果

 * updates: centos.ustc.edu.cn
Loading mirror speeds from cached hostfile
Loaded plugins: fastestmirror, langpacks
* extras: centos.ustc.edu.cn
docker-ce.x86_64 18.03..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.12..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.12..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.09..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.09..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.06..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.06..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.06..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.03..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.03..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.03..ce-.el7.centos docker-ce-stable

安装指定版本

[root@bogon ~]# sudo yum install docker-ce-17.12.0.ce-1.el7.centos

安装结果

Total                                                                                                        kB/s |   MB  ::
Retrieving key from https://download-stage.docker.com/linux/centos/gpg
Importing GPG key 0x621E9F35:
Userid : "Docker Release (CE rpm) <docker@docker.com>"
Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
From : https://download-stage.docker.com/linux/centos/gpg
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : :container-selinux-2.42-.gitad8f0f7.el7.noarch /
Installing : docker-ce-17.12..ce-.el7.centos.x86_64 /
Verifying : :container-selinux-2.42-.gitad8f0f7.el7.noarch /
Verifying : docker-ce-17.12..ce-.el7.centos.x86_64 / Installed:
docker-ce.x86_64 :17.12..ce-.el7.centos Dependency Installed:
container-selinux.noarch :2.42-.gitad8f0f7.el7 Complete!
[root@bogon ~]#