docker包资源:
https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
安装报错有依赖:
# rpm -ivh docker-ce-17.03.0.ce-1.el7.centos.x86_64.rpm
warning: docker-ce-17.03.0.ce-1.el7.centos.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
error: Failed dependencies:
docker-ce-selinux >= 17.03.0.ce-1.el7.centos is needed by docker-ce-17.03.0.ce-1.el7.centos.x86_64
依次查找出依赖包
# rpm -ivh docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm
warning: docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
error: Failed dependencies:
policycoreutils-python is needed by docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch
# rpm -ivh policycoreutils-python-2.5-17.1.el7.x86_64.rpm
warning: policycoreutils-python-2.5-17.1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
error: Failed dependencies:
audit-libs-python >= 2.1.3-4 is needed by policycoreutils-python-2.5-17.1.el7.x86_64
checkpolicy is needed by policycoreutils-python-2.5-17.1.el7.x86_64
libapol.so.4()(64bit) is needed by policycoreutils-python-2.5-17.1.el7.x86_64
libapol.so.4(VERS_4.0)(64bit) is needed by policycoreutils-python-2.5-17.1.el7.x86_64
libqpol.so.1()(64bit) is needed by policycoreutils-python-2.5-17.1.el7.x86_64
libqpol.so.1(VERS_1.2)(64bit) is needed by policycoreutils-python-2.5-17.1.el7.x86_64
libqpol.so.1(VERS_1.4)(64bit) is needed by policycoreutils-python-2.5-17.1.el7.x86_64
libsemanage-python >= 2.5-5 is needed by policycoreutils-python-2.5-17.1.el7.x86_64
python-IPy is needed by policycoreutils-python-2.5-17.1.el7.x86_64
setools-libs >= 3.3.8-1 is needed by policycoreutils-python-2.5-17.1.el7.x86_64
按照系统中相关包的版本去找相同版本的包安装
# rpm -qa | grep audit
audit-libs-2.7.6-3.el7.x86_64
audit-2.7.6-3.el7.x86_64
下载各个包
ftp://ftp.pbone.net/mirror/ftp.scientificlinux.org/linux/scientific/7.4/x86_64/os/Packages/audit-libs-python-2.7.6-3.el7.x86_64.rpm
依次安装包
# rpm -ivh audit-libs-python-2.7.6-3.el7.x86_64.rpm
# rpm -ivh checkpolicy-2.5-8.el7.x86_64.rpm
# rpm -ivh libsemanage-python-2.5-8.el7.x86_64.rpm
# rpm -ivh python-IPy-0.75-6.el7.noarch.rpm
# rpm -ivh setools-libs-3.3.8-1.1.el7.x86_64.rpm
# rpm -ivh policycoreutils-python-2.5-17.1.el7.x86_64.rpm
# rpm -ivh docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm
# rpm -ivh docker-ce-17.03.0.ce-1.el7.centos.x86_64.rpm
也可以使用 yum localinstall *.rpm 自动匹配依赖包。
如果存在可以访问外网的环境,可以使用下面命令一键下载所有依赖的软件包:
可以使用下面命令查看源中存在的docker版本
# yum list docker-ce --showduplicates
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Available Packages
docker-ce.x86_64 17.03.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.2.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.3.ce-1.el7 docker-ce-stable
docker-ce.x86_64 17.06.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.06.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.06.2.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.09.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.09.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.12.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.12.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 18.03.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 18.03.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 18.06.0.ce-3.el7 docker-ce-stable
docker-ce.x86_64 18.06.1.ce-3.el7 docker-ce-stable
docker-ce.x86_64 18.06.2.ce-3.el7 docker-ce-stable
docker-ce.x86_64 18.06.3.ce-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.0-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.1-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.2-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.3-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.4-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.5-3.el7 docker-ce-stable
使用下面命令可以只下载docker的包而不安装
# yum install --downloadonly --downloaddir=
--downloaddir指定存放的目录,需要创建的
如下所示,不指定版本是下载最新的docker包
# yum install --downloadonly --downloaddir=/data/packages docker-ce
安装之前的包需要指定具体的版本,另外还要多加一个参数--setopt=obsoletes=0
# yum install --setopt=obsoletes=0 --downloadonly --downloaddir=/data/packages docker-ce-17.03.0.ce
然后拷贝到没网的服务器再使用 yum localinstall *.rpm 自动匹配依赖包。
参考:
https://blog.csdn.net/nklinsirui/article/details/80610058