Kubernetes 环境部署 docker离线包准备

在能联网的服务器上


1、安装yumdownloader

yumdownloader是什么:yumdownloader is a program for downloading RPMs from Yum repositories

安装:yum install yum-utils -y

2、获取docker安装包及依赖(test目录存放所有的离线包)
https://docs.docker.com/engine/install/centos/

[root@master01 test]# yum list docker-ce --showduplicates | sort -r
Last metadata expiration check: 0:00:01 ago on Mon 23 Aug 2021 11:09:52 AM CST.
docker-ce.x86_64                3:20.10.8-3.el8                 docker-ce-stable
docker-ce.x86_64                3:20.10.7-3.el8                 docker-ce-stable
docker-ce.x86_64                3:20.10.6-3.el8                 docker-ce-stable
docker-ce.x86_64                3:20.10.5-3.el8                 docker-ce-stable
docker-ce.x86_64                3:20.10.4-3.el8                 docker-ce-stable
docker-ce.x86_64                3:20.10.3-3.el8                 docker-ce-stable
docker-ce.x86_64                3:20.10.2-3.el8                 docker-ce-stable
docker-ce.x86_64                3:20.10.1-3.el8                 docker-ce-stable
docker-ce.x86_64                3:20.10.0-3.el8                 docker-ce-stable
docker-ce.x86_64                3:19.03.15-3.el8                docker-ce-stable
docker-ce.x86_64                3:19.03.14-3.el8                docker-ce-stable
docker-ce.x86_64                3:19.03.13-3.el8                docker-ce-stable
Docker CE Stable - x86_64                        24 kB/s |  15 kB     00:00    
Available Packages


[root@master01 test]#  yumdownloader --resolve --destdir . docker-ce
Last metadata expiration check: 0:09:55 ago on Mon 23 Aug 2021 11:09:52 AM CST.
[SKIPPED] docker-ce-20.10.8-3.el8.x86_64.rpm: Already downloaded                                                                      
[SKIPPED] libsemanage-2.9-6.el8.x86_64.rpm: Already downloaded                                                                        
[SKIPPED] fuse-common-3.2.1-12.el8.x86_64.rpm: Already downloaded                                                                     
[SKIPPED] fuse3-3.2.1-12.el8.x86_64.rpm: Already downloaded                                                                           
[SKIPPED] docker-ce-cli-20.10.8-3.el8.x86_64.rpm: Already downloaded                                                                  
[SKIPPED] fuse3-libs-3.2.1-12.el8.x86_64.rpm: Already downloaded                                                                      
[SKIPPED] docker-ce-rootless-extras-20.10.8-3.el8.x86_64.rpm: Already downloaded                                                      
[SKIPPED] docker-scan-plugin-0.8.0-3.el8.x86_64.rpm: Already downloaded                                                               
[SKIPPED] python3-libsemanage-2.9-6.el8.x86_64.rpm: Already downloaded                                                                
[SKIPPED] libcgroup-0.41-19.el8.x86_64.rpm: Already downloaded                                                                        
[SKIPPED] slirp4netns-1.1.8-1.module_el8.4.0+641+6116a774.x86_64.rpm: Already downloaded                                              
[SKIPPED] python3-policycoreutils-2.9-14.el8.noarch.rpm: Already downloaded                                                           
[SKIPPED] container-selinux-2.164.1-1.module_el8.4.0+886+c9a8d9ad.noarch.rpm: Already downloaded                                      
[SKIPPED] python3-setools-4.3.0-2.el8.x86_64.rpm: Already downloaded                                                                  
[SKIPPED] policycoreutils-2.9-14.el8.x86_64.rpm: Already downloaded                                                                   
[SKIPPED] policycoreutils-python-utils-2.9-14.el8.noarch.rpm: Already downloaded                                                      
[SKIPPED] checkpolicy-2.9-1.el8.x86_64.rpm: Already downloaded                                                                        
[SKIPPED] libslirp-4.3.1-1.module_el8.4.0+575+63b40ad7.x86_64.rpm: Already downloaded                                                 
[SKIPPED] tar-1.30-5.el8.x86_64.rpm: Already downloaded                                                                               
[SKIPPED] fuse-overlayfs-1.6-1.module_el8.4.0+886+c9a8d9ad.x86_64.rpm: Already downloaded                                             
[SKIPPED] python3-audit-3.0-0.17.20191104git1c2f876.el8.x86_64.rpm: Already downloaded                                                
[SKIPPED] containerd.io-1.4.9-3.1.el8.x86_64.rpm: Already downloaded  

 安装一些Linux操作系统所需要的依赖

[root@master01 test]#  yumdownloader --resolve --destdir . chrony bind-utils nfs-utils net-tools ipvsadm  curl openssl socat conntrack ebtables ipset telnet


[root@master01 test]# ls
bind-libs-9.11.26-4.el8_4.x86_64.rpm                                gssproxy-0.8.0-19.el8.x86_64.rpm                         policycoreutils-2.9-14.el8.x86_64.rpm
bind-libs-lite-9.11.26-4.el8_4.x86_64.rpm                           ipset-7.1-1.el8.x86_64.rpm                               policycoreutils-python-utils-2.9-14.el8.noarch.rpm
bind-license-9.11.26-4.el8_4.noarch.rpm                             iptables-1.8.4-17.el8.x86_64.rpm                         protobuf-c-1.3.0-6.el8.x86_64.rpm
bind-utils-9.11.26-4.el8_4.x86_64.rpm                               iptables-ebtables-1.8.4-17.el8.x86_64.rpm                python3-audit-3.0-0.17.20191104git1c2f876.el8.x86_64.rpm
checkpolicy-2.9-1.el8.x86_64.rpm                                    iptables-libs-1.8.4-17.el8.x86_64.rpm                    python3-bind-9.11.26-4.el8_4.noarch.rpm
chrony-3.5-2.el8.x86_64.rpm                                         ipvsadm-1.31-1.el8.x86_64.rpm                            python3-libsemanage-2.9-6.el8.x86_64.rpm
conntrack-tools-1.4.4-10.el8.x86_64.rpm                             keyutils-1.5.10-6.el8.x86_64.rpm                         python3-ply-3.9-9.el8.noarch.rpm
containerd.io-1.4.9-3.1.el8.x86_64.rpm                              libcgroup-0.41-19.el8.x86_64.rpm                         python3-policycoreutils-2.9-14.el8.noarch.rpm
container-selinux-2.164.1-1.module_el8.4.0+886+c9a8d9ad.noarch.rpm  libcurl-7.61.1-18.el8.x86_64.rpm                         python3-pyyaml-3.12-12.el8.x86_64.rpm
curl-7.61.1-18.el8.x86_64.rpm                                       libnetfilter_cthelper-1.0.0-15.el8.x86_64.rpm            python3-setools-4.3.0-2.el8.x86_64.rpm
docker-ce-20.10.8-3.el8.x86_64.rpm                                  libnetfilter_cttimeout-1.0.0-11.el8.x86_64.rpm           quota-4.04-12.el8.x86_64.rpm
docker-ce-cli-20.10.8-3.el8.x86_64.rpm                              libnetfilter_queue-1.0.4-3.el8.x86_64.rpm                quota-nls-4.04-12.el8.noarch.rpm
docker-ce-rootless-extras-20.10.8-3.el8.x86_64.rpm                  libsemanage-2.9-6.el8.x86_64.rpm                         rpcbind-1.2.5-8.el8.x86_64.rpm
docker-scan-plugin-0.8.0-3.el8.x86_64.rpm                           libslirp-4.3.1-1.module_el8.4.0+575+63b40ad7.x86_64.rpm  slirp4netns-1.1.8-1.module_el8.4.0+641+6116a774.x86_64.rpm
fstrm-0.6.0-3.el8.1.x86_64.rpm                                      libverto-libevent-0.3.0-5.el8.x86_64.rpm                 socat-1.7.3.3-2.el8.x86_64.rpm
fuse3-3.2.1-12.el8.x86_64.rpm                                       net-tools-2.0-0.52.20160912git.el8.x86_64.rpm            tar-1.30-5.el8.x86_64.rpm
fuse3-libs-3.2.1-12.el8.x86_64.rpm                                  nfs-utils-2.3.3-41.el8_4.2.x86_64.rpm                    telnet-0.17-76.el8.x86_64.rpm
fuse-common-3.2.1-12.el8.x86_64.rpm                                 openssl-1.1.1g-15.el8_3.x86_64.rpm                       timedatex-0.5-3.el8.x86_64.rpm
fuse-overlayfs-1.6-1.module_el8.4.0+886+c9a8d9ad.x86_64.rpm         openssl-libs-1.1.1g-15.el8_3.x86_64.rpm

3.安装本地离线包 

[root@master01 ~]# tar czf rpm.tar.gz test
[root@master01 ~]# ls
rpm.tar.gz  test

在其他离线环境就可以使用这个包安装了 

[root@master01 ~]# yum localinstall *.rpm
[root@master01 test]# systemctl start docker
[root@master01 test]# docker version
Client: Docker Engine - Community
 Version:           20.10.8
 API version:       1.41
 Go version:        go1.16.6
 Git commit:        3967b7d
 Built:             Fri Jul 30 19:53:39 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.8
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.6
  Git commit:       75249d8
  Built:            Fri Jul 30 19:52:00 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.9
  GitCommit:        e25210fe30a0a703442421b0f60afac609f950a3
 runc:
  Version:          1.0.1
  GitCommit:        v1.0.1-0-g4144b63
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

这样在离线情况下docker环境就准备好了

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值