欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Centos 离线安装 docker docker-compose

程序员文章站 2024-01-11 20:16:10
...

Docker离线安装

安装 2+8+2 个依赖

一 分别安装 2个依赖

docker-ce-cli-18.09.8-3.el7.x86_64.rpm
containerd.io-1.2.2-3.el7.x86_64.rpm

[aaa@qq.com docker]# rpm -ivh docker-ce-cli-18.09.8-3.el7.x86_64.rpm 
警告:docker-ce-cli-18.09.8-3.el7.x86_64.rpm: 头V4 RSA/SHA512 Signature, ** ID 621e9f35: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:docker-ce-cli-1:18.09.8-3.el7    ################################# [100%]
[aaa@qq.com docker]#
[aaa@qq.com docker]# rpm -ivh containerd.io-1.2.2-3.el7.x86_64.rpm 
警告:containerd.io-1.2.2-3.el7.x86_64.rpm: 头V4 RSA/SHA512 Signature, ** ID 621e9f35: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:containerd.io-1.2.2-3.el7        ################################# [100%]
[aaa@qq.com docker]#

二 统一安装8个依赖:

audit-libs-python-2.8.5-4.el7.x86_64.rpm
libcgroup-0.41-21.el7.x86_64.rpm
libsemanage-python-2.5-14.el7.x86_64.rpm
python-IPy-0.75-6.el7.noarch.rpm
checkpolicy-2.5-8.el7.x86_64.rpm
libseccomp-2.3.1-4.el7.x86_64.rpm
policycoreutils-python-2.5-34.el7.x86_64.rpm
setools-libs-3.3.8-4.el7.x86_64.rpm

[aaa@qq.com docker]# ls
audit-libs-python-2.8.5-4.el7.x86_64.rpm  libcgroup-0.41-21.el7.x86_64.rpm   libsemanage-python-2.5-14.el7.x86_64.rpm      python-IPy-0.75-6.el7.noarch.rpm
checkpolicy-2.5-8.el7.x86_64.rpm          libseccomp-2.3.1-4.el7.x86_64.rpm  policycoreutils-python-2.5-34.el7.x86_64.rpm  setools-libs-3.3.8-4.el7.x86_64.rpm
[aaa@qq.com docker]# 
[aaa@qq.com docker]# 
[aaa@qq.com docker]# 
[aaa@qq.com docker]# 
[aaa@qq.com docker]# rpm -Uvh *.rpm --nodeps --force
准备中...                          ################################# [100%]
正在升级/安装...
   1:setools-libs-3.3.8-4.el7         ################################# [ 13%]
   2:python-IPy-0.75-6.el7            ################################# [ 25%]
   3:libsemanage-python-2.5-14.el7    ################################# [ 38%]
   4:libcgroup-0.41-21.el7            ################################# [ 50%]
   5:checkpolicy-2.5-8.el7            ################################# [ 63%]
   6:audit-libs-python-2.8.5-4.el7    ################################# [ 75%]
   7:policycoreutils-python-2.5-34.el7################################# [ 88%]
   8:libseccomp-2.3.1-4.el7           ################################# [100%]
[aaa@qq.com docker]# 

三 分别安装 2 个依赖

container-selinux-2.107-3.el7.noarch.rpm
docker-ce-18.09.8-3.el7.x86_64.rpm

[aaa@qq.com docker]# rpm -ivh container-selinux-2.107-3.el7.noarch.rpm 
准备中...                          ################################# [100%]
正在升级/安装...
   1:container-selinux-2:2.107-3.el7  ################################# [100%]
setsebool:  SELinux is disabled.
[aaa@qq.com docker]# 
[aaa@qq.com docker]# rpm -ivh docker-ce-18.09.8-3.el7.x86_64.rpm 
警告:docker-ce-18.09.8-3.el7.x86_64.rpm: 头V4 RSA/SHA512 Signature, ** ID 621e9f35: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:docker-ce-3:18.09.8-3.el7        ################################# [100%]
[aaa@qq.com docker]#

依赖源下载链接:

2个依赖
containerd.io:
docker-ce-cli:

8个依赖
http://mirrors.163.com/centos/7/os/x86_64/Packages/

2个依赖
docker-ce
container-selinux

整理依赖统一下载:

	链接:https://pan.baidu.com/s/1olYwonH3udN6yJojDajd7g 
	提取码:7x5w

参考文章:
https://www.jianshu.com/p/764ec08196e0
https://blog.csdn.net/u013058742/article/details/80075633
https://www.cnblogs.com/eastonliu/p/11277014.html

docker-compose 离线安装

github上找到对应版本下载,要和 docker 版本对应
Centos 离线安装 docker docker-compose
https://github.com/docker/compose/releases/tag/1.22.0
一 下载 docker-compose-Linux-x86_64 版本的 docker-compose

链接:https://pan.baidu.com/s/1FnqKiHHi_TWWJUBbjOw9Dw 
提取码:nj2r

二 移动指定目录并授权

将下载下来的“docker-compose-Linux-x86_64”文件上传到服务器上,将其移动到 /usr/local/bin目录,并改名为“docker-compose”

[aaa@qq.com docker-compose]# cp docker-compose-Linux-x86_64 /usr/local/bin/ && cd /usr/local/bin/ && mv docker-compose-Linux-x86_64 docker-compose
[aaa@qq.com bin]# pwd
/usr/local/bin
[aaa@qq.com bin]# chmod +x /usr/local/bin/docker-compose
[aaa@qq.com bin]# 
[aaa@qq.com bin]# docker-compose -v
docker-compose version 1.22.0, build f46880fe
[aaa@qq.com bin]#

参考文章:
https://www.hangge.com/blog/cache/detail_2469.html

相关标签: Docker