Docker 安裝指定版本

2021-10-18 23:15:14 字數 2545 閱讀 1873

安裝指定的docker版本:17.03.1

[root@s2 docker]# ls -la

total 8128

drwxr-xr-x. 2 root root 180 may 2 08:31 .

drwxr-xr-x. 3 root root 20 apr 20 10:58 ..

-rw-r--r-- 1 root root 2705534 may 2 08:19 docker-ce-17.03.1.ce-1.el7.centos.x86_64.rpm

-rw-r--r-- 1 root root 5579832 may 2 08:31 docker-ce-debuginfo-17.03.1.ce-1.el7.centos.x86_64.rpm

-rw-r--r-- 1 root root 29108 feb 13 19:33 docker-ce-selinux-17.03.1.ce-1.el7.centos.noarch.rpm

解除安裝原有的版本

yum remove -y docker* container-selinux

安裝rpm包

yum localinstall -y *.rpm

首先執行 docker 發現不可以

查詢 *.rpm 是否已經安裝

[root@s2 docker]#  yum list installed | grep docker

docker-ce-debuginfo.x86_64 17.03.1.ce-1.el7.centos @/docker-ce-debuginfo-17.03.1.ce-1.el7.centos.x86_64

docker-ce-selinux.noarch 17.03.1.ce-1.el7.centos @/docker-ce-selinux-17.03.1.ce-1.el7.centos.noarch

從 2 可以發現缺少了主要的docker安裝包 docker-ce.x86_64,然後單獨執行

[root@s2 docker]# yum localinstall -y docker-ce-17.03.1.ce-1.el7.centos.x86_64.rpm           

loaded plugins: fastestmirror

examining docker-ce-17.03.1.ce-1.el7.centos.x86_64.rpm: docker-ce-17.03.1.ce-1.el7.centos.x86_64

marking docker-ce-17.03.1.ce-1.el7.centos.x86_64.rpm to be installed

resolving dependencies

--> running transaction check

---> package docker-ce.x86_64 0:17.03.1.ce-1.el7.centos will be installed

--> processing dependency: docker-ce-selinux >= 17.03.1.ce-1.el7.centos for package: docker-ce-17.03.1.ce-1.el7.centos.x86_64

loading mirror speeds from cached hostfile

* base: mirrors.aliyun.com

* extras: mirrors.aliyun.com

* updates: mirrors.aliyun.com

--> finished dependency resolution

error: package: docker-ce-17.03.1.ce-1.el7.centos.x86_64 (/docker-ce-17.03.1.ce-1.el7.centos.x86_64)

requires: docker-ce-selinux >= 17.03.1.ce-1.el7.centos

you could try using --skip-broken to work around the problem

you could try running: rpm -va --nofiles --nodigest

從 3 可以看出安裝的時候已經報error

在網上很多類似的問題,都指向 daemon.json 檔案錯誤,但是這裡壓根沒有 daemon.json 檔案,直接跳過,也有說是之前安裝過新的版本,現在安裝舊版本導致,需要忽略obsoletes即可,其實我發現還有乙個情況。就是安裝的順序

yum install  

yum install

[eddie@localhost /

]# yum -y update

[eddie@localhost /

]# yum install -y docker

created by eddie.lee

安裝指定版本的docker

從 2017 年 3 月開始 docker 在原來的基礎上分為兩個分支版本 docker ce 和 docker ee。docker ce 即社群免費版,docker ee 即企業版,強調安全,但需付費使用。本文介紹 docker ce 的安裝使用。移除舊的版本 sudo yum remove do...

centos安裝指定版本的docker

安裝依賴包 新增docker軟體包源 yum config manager add repo如果無法連線 改為國內源 yum config manager add repo 關閉測試版本list 只顯示穩定版 sudo yum config manager enable docker ce edge...

安裝 指定版本 conda 安裝指定版本的指定包

tuna 還提供了 anaconda 倉庫的映象,執行以下命令 conda config add channels conda config set show channel urls yes 即可新增 anaconda python 免費倉庫。中科大的映象 conda config add cha...