Linux docker依赖离线安装

这篇具有很好参考价值的文章主要介绍了Linux docker依赖离线安装。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

以Cento是7.5安装docker为例,首先需要在可联网的服务器或者虚拟机下载相关依赖,将依赖拷贝至离线服务器再安装。

可联网的服务器或者虚拟机配置docker源

官方源:https://download.docker.com/linux/centos/docker-ce.repo

[root@bogon /]# curl https://download.docker.com/linux/centos/docker-ce.repo -o  /etc/yum.repos.d/docker-ce.repo
[root@bogon /]#yum clean all
[root@bogon /]#yum makecache

yum自动下载docker相关依赖包

[root@bogon /]#  yum install --downloaddir=/home/temp/docker --downloadonly docker-ce-19.03.8-3.el7.x86_64

将依赖拷贝至离线服务器对应目录

cd 进离线服务器对应目录使用sudo yum localinstall xxx 安装,将所有依赖包都加上,以空格隔开:

[root@bogon docker]# sudo yum localinstall containerd.io-1.6.21-3.1.el7.x86_64.rpm container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm docker-buildx-plugin-0.11.1-1.el7.x86_64.rpm docker-ce-19.03.8-3.el7.x86_64.rpm docker-ce-cli-24.0.3-1.el7.x86_64.rpm docker-compose-plugin-2.19.1-1.el7.x86_64.rpm libselinux-python-2.5-15.el7.x86_64.rpm libselinux-utils-2.5-15.el7.x86_64.rpm libsemanage-2.5-14.el7.x86_64.rpm libsemanage-python-2.5-14.el7.x86_64.rpm policycoreutils-2.5-34.el7.x86_64.rpm policycoreutils-python-2.5-34.el7.x86_64.rpm selinux-policy-3.13.1-268.el7_9.2.noarch.rpm selinux-policy-targeted-3.13.1-268.el7_9.2.noarch.rpm setools-libs-3.3.8-4.el7.x86_64.rpm libsepol-2.5-10.el7.x86_64.rpm libselinux-2.5-15.el7.x86_64.rpm 
Loaded plugins: fastestmirror, langpacks
Examining containerd.io-1.6.21-3.1.el7.x86_64.rpm: containerd.io-1.6.21-3.1.el7.x86_64
Marking containerd.io-1.6.21-3.1.el7.x86_64.rpm to be installed
Examining container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm: 2:container-selinux-2.119.2-1.911c772.el7_8.noarch
Marking container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm to be installed
Examining docker-buildx-plugin-0.11.1-1.el7.x86_64.rpm: docker-buildx-plugin-0.11.1-1.el7.x86_64
Marking docker-buildx-plugin-0.11.1-1.el7.x86_64.rpm to be installed
Examining docker-ce-19.03.8-3.el7.x86_64.rpm: 3:docker-ce-19.03.8-3.el7.x86_64
Marking docker-ce-19.03.8-3.el7.x86_64.rpm to be installed
Examining docker-ce-cli-24.0.3-1.el7.x86_64.rpm: 1:docker-ce-cli-24.0.3-1.el7.x86_64
Marking docker-ce-cli-24.0.3-1.el7.x86_64.rpm to be installed
Examining docker-compose-plugin-2.19.1-1.el7.x86_64.rpm: docker-compose-plugin-2.19.1-1.el7.x86_64
Marking docker-compose-plugin-2.19.1-1.el7.x86_64.rpm to be installed
Examining libselinux-python-2.5-15.el7.x86_64.rpm: libselinux-python-2.5-15.el7.x86_64
Marking libselinux-python-2.5-15.el7.x86_64.rpm as an update to libselinux-python-2.5-12.el7.x86_64
Examining libselinux-utils-2.5-15.el7.x86_64.rpm: libselinux-utils-2.5-15.el7.x86_64
Marking libselinux-utils-2.5-15.el7.x86_64.rpm as an update to libselinux-utils-2.5-12.el7.x86_64
Examining libsemanage-2.5-14.el7.x86_64.rpm: libsemanage-2.5-14.el7.x86_64
Marking libsemanage-2.5-14.el7.x86_64.rpm as an update to libsemanage-2.5-11.el7.x86_64
Examining libsemanage-python-2.5-14.el7.x86_64.rpm: libsemanage-python-2.5-14.el7.x86_64
Marking libsemanage-python-2.5-14.el7.x86_64.rpm as an update to libsemanage-python-2.5-11.el7.x86_64
Examining policycoreutils-2.5-34.el7.x86_64.rpm: policycoreutils-2.5-34.el7.x86_64
Marking policycoreutils-2.5-34.el7.x86_64.rpm as an update to policycoreutils-2.5-22.el7.x86_64
Examining policycoreutils-python-2.5-34.el7.x86_64.rpm: policycoreutils-python-2.5-34.el7.x86_64
Marking policycoreutils-python-2.5-34.el7.x86_64.rpm as an update to policycoreutils-python-2.5-22.el7.x86_64
Examining selinux-policy-3.13.1-268.el7_9.2.noarch.rpm: selinux-policy-3.13.1-268.el7_9.2.noarch
Marking selinux-policy-3.13.1-268.el7_9.2.noarch.rpm as an update to selinux-policy-3.13.1-192.el7.noarch
Examining selinux-policy-targeted-3.13.1-268.el7_9.2.noarch.rpm: selinux-policy-targeted-3.13.1-268.el7_9.2.noarch
Marking selinux-policy-targeted-3.13.1-268.el7_9.2.noarch.rpm as an update to selinux-policy-targeted-3.13.1-192.el7.noarch
Examining setools-libs-3.3.8-4.el7.x86_64.rpm: setools-libs-3.3.8-4.el7.x86_64
Marking setools-libs-3.3.8-4.el7.x86_64.rpm as an update to setools-libs-3.3.8-2.el7.x86_64
Examining libsepol-2.5-10.el7.x86_64.rpm: libsepol-2.5-10.el7.x86_64
libsepol-2.5-10.el7.x86_64.rpm: does not update installed package.
Examining libselinux-2.5-15.el7.x86_64.rpm: libselinux-2.5-15.el7.x86_64
Marking libselinux-2.5-15.el7.x86_64.rpm as an update to libselinux-2.5-12.el7.x86_64
Resolving Dependencies
--> Running transaction check
---> Package container-selinux.noarch 2:2.119.2-1.911c772.el7_8 will be installed
---> Package containerd.io.x86_64 0:1.6.21-3.1.el7 will be installed
---> Package docker-buildx-plugin.x86_64 0:0.11.1-1.el7 will be installed
---> Package docker-ce.x86_64 3:19.03.8-3.el7 will be installed
---> Package docker-ce-cli.x86_64 1:24.0.3-1.el7 will be installed
---> Package docker-compose-plugin.x86_64 0:2.19.1-1.el7 will be installed
---> Package libselinux.x86_64 0:2.5-12.el7 will be updated
---> Package libselinux.x86_64 0:2.5-15.el7 will be an update
---> Package libselinux-python.x86_64 0:2.5-12.el7 will be updated
---> Package libselinux-python.x86_64 0:2.5-15.el7 will be an update
---> Package libselinux-utils.x86_64 0:2.5-12.el7 will be updated
---> Package libselinux-utils.x86_64 0:2.5-15.el7 will be an update
---> Package libsemanage.x86_64 0:2.5-11.el7 will be updated
---> Package libsemanage.x86_64 0:2.5-14.el7 will be an update
---> Package libsemanage-python.x86_64 0:2.5-11.el7 will be updated
---> Package libsemanage-python.x86_64 0:2.5-14.el7 will be an update
---> Package policycoreutils.x86_64 0:2.5-22.el7 will be updated
---> Package policycoreutils.x86_64 0:2.5-34.el7 will be an update
---> Package policycoreutils-python.x86_64 0:2.5-22.el7 will be updated
---> Package policycoreutils-python.x86_64 0:2.5-34.el7 will be an update
---> Package selinux-policy.noarch 0:3.13.1-192.el7 will be updated
---> Package selinux-policy.noarch 0:3.13.1-268.el7_9.2 will be an update
---> Package selinux-policy-targeted.noarch 0:3.13.1-192.el7 will be updated
---> Package selinux-policy-targeted.noarch 0:3.13.1-268.el7_9.2 will be an update
---> Package setools-libs.x86_64 0:3.3.8-2.el7 will be updated
---> Package setools-libs.x86_64 0:3.3.8-4.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================
 Package                 Arch   Version                Repository                                          Size
================================================================================================================
Installing:
 container-selinux       noarch 2:2.119.2-1.911c772.el7_8
                                                       /container-selinux-2.119.2-1.911c772.el7_8.noarch   41 k
 containerd.io           x86_64 1.6.21-3.1.el7         /containerd.io-1.6.21-3.1.el7.x86_64               114 M
 docker-buildx-plugin    x86_64 0.11.1-1.el7           /docker-buildx-plugin-0.11.1-1.el7.x86_64           59 M
 docker-ce               x86_64 3:19.03.8-3.el7        /docker-ce-19.03.8-3.el7.x86_64                    104 M
 docker-ce-cli           x86_64 1:24.0.3-1.el7         /docker-ce-cli-24.0.3-1.el7.x86_64                  35 M
 docker-compose-plugin   x86_64 2.19.1-1.el7           /docker-compose-plugin-2.19.1-1.el7.x86_64          58 M
Updating:
 libselinux              x86_64 2.5-15.el7             /libselinux-2.5-15.el7.x86_64                      213 k
 libselinux-python       x86_64 2.5-15.el7             /libselinux-python-2.5-15.el7.x86_64               589 k
 libselinux-utils        x86_64 2.5-15.el7             /libselinux-utils-2.5-15.el7.x86_64                172 k
 libsemanage             x86_64 2.5-14.el7             /libsemanage-2.5-14.el7.x86_64                     295 k
 libsemanage-python      x86_64 2.5-14.el7             /libsemanage-python-2.5-14.el7.x86_64              441 k
 policycoreutils         x86_64 2.5-34.el7             /policycoreutils-2.5-34.el7.x86_64                 5.1 M
 policycoreutils-python  x86_64 2.5-34.el7             /policycoreutils-python-2.5-34.el7.x86_64          1.2 M
 selinux-policy          noarch 3.13.1-268.el7_9.2     /selinux-policy-3.13.1-268.el7_9.2.noarch          6.7 k
 selinux-policy-targeted noarch 3.13.1-268.el7_9.2     /selinux-policy-targeted-3.13.1-268.el7_9.2.noarch  19 M
 setools-libs            x86_64 3.3.8-4.el7            /setools-libs-3.3.8-4.el7.x86_64                   1.8 M

Transaction Summary
================================================================================================================
Install   6 Packages
Upgrade  10 Packages

Total size: 399 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Updating   : libselinux-2.5-15.el7.x86_64                                                                1/26 
  Updating   : libsemanage-2.5-14.el7.x86_64                                                               2/26 
  Updating   : libselinux-utils-2.5-15.el7.x86_64                                                          3/26 
  Updating   : policycoreutils-2.5-34.el7.x86_64                                                           4/26 
  Updating   : selinux-policy-3.13.1-268.el7_9.2.noarch                                                    5/26 
  Updating   : selinux-policy-targeted-3.13.1-268.el7_9.2.noarch                                           6/26 
  Updating   : libsemanage-python-2.5-14.el7.x86_64                                                        7/26 
  Updating   : libselinux-python-2.5-15.el7.x86_64                                                         8/26 
  Updating   : setools-libs-3.3.8-4.el7.x86_64                                                             9/26 
  Updating   : policycoreutils-python-2.5-34.el7.x86_64                                                   10/26 
  Installing : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch                                         11/26 
  Installing : containerd.io-1.6.21-3.1.el7.x86_64                                                        12/26 
  Installing : docker-compose-plugin-2.19.1-1.el7.x86_64                                                  13/26 
  Installing : docker-buildx-plugin-0.11.1-1.el7.x86_64                                                   14/26 
  Installing : 1:docker-ce-cli-24.0.3-1.el7.x86_64                                                        15/26 
  Installing : 3:docker-ce-19.03.8-3.el7.x86_64                                                           16/26 
  Cleanup    : selinux-policy-targeted-3.13.1-192.el7.noarch                                              17/26 
  Cleanup    : policycoreutils-python-2.5-22.el7.x86_64                                                   18/26 
  Cleanup    : selinux-policy-3.13.1-192.el7.noarch                                                       19/26 
  Cleanup    : policycoreutils-2.5-22.el7.x86_64                                                          20/26 
  Cleanup    : libselinux-utils-2.5-12.el7.x86_64                                                         21/26 
  Cleanup    : setools-libs-3.3.8-2.el7.x86_64                                                            22/26 
  Cleanup    : libselinux-python-2.5-12.el7.x86_64                                                        23/26 
  Cleanup    : libsemanage-python-2.5-11.el7.x86_64                                                       24/26 
  Cleanup    : libsemanage-2.5-11.el7.x86_64                                                              25/26 
  Cleanup    : libselinux-2.5-12.el7.x86_64                                                               26/26 
  Verifying  : docker-buildx-plugin-0.11.1-1.el7.x86_64                                                    1/26 
  Verifying  : 1:docker-ce-cli-24.0.3-1.el7.x86_64                                                         2/26 
  Verifying  : containerd.io-1.6.21-3.1.el7.x86_64                                                         3/26 
  Verifying  : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch                                          4/26 
  Verifying  : selinux-policy-targeted-3.13.1-268.el7_9.2.noarch                                           5/26 
  Verifying  : policycoreutils-2.5-34.el7.x86_64                                                           6/26 
  Verifying  : libselinux-utils-2.5-15.el7.x86_64                                                          7/26 
  Verifying  : policycoreutils-python-2.5-34.el7.x86_64                                                    8/26 
  Verifying  : libselinux-2.5-15.el7.x86_64                                                                9/26 
  Verifying  : libsemanage-python-2.5-14.el7.x86_64                                                       10/26 
  Verifying  : libsemanage-2.5-14.el7.x86_64                                                              11/26 
  Verifying  : libselinux-python-2.5-15.el7.x86_64                                                        12/26 
  Verifying  : 3:docker-ce-19.03.8-3.el7.x86_64                                                           13/26 
  Verifying  : selinux-policy-3.13.1-268.el7_9.2.noarch                                                   14/26 
  Verifying  : docker-compose-plugin-2.19.1-1.el7.x86_64                                                  15/26 
  Verifying  : setools-libs-3.3.8-4.el7.x86_64                                                            16/26 
  Verifying  : libsemanage-python-2.5-11.el7.x86_64                                                       17/26 
  Verifying  : libsemanage-2.5-11.el7.x86_64                                                              18/26 
  Verifying  : libselinux-python-2.5-12.el7.x86_64                                                        19/26 
  Verifying  : setools-libs-3.3.8-2.el7.x86_64                                                            20/26 
  Verifying  : policycoreutils-2.5-22.el7.x86_64                                                          21/26 
  Verifying  : policycoreutils-python-2.5-22.el7.x86_64                                                   22/26 
  Verifying  : selinux-policy-targeted-3.13.1-192.el7.noarch                                              23/26 
  Verifying  : selinux-policy-3.13.1-192.el7.noarch                                                       24/26 
  Verifying  : libselinux-2.5-12.el7.x86_64                                                               25/26 
  Verifying  : libselinux-utils-2.5-12.el7.x86_64                                                         26/26 

Installed:
  container-selinux.noarch 2:2.119.2-1.911c772.el7_8         containerd.io.x86_64 0:1.6.21-3.1.el7              
  docker-buildx-plugin.x86_64 0:0.11.1-1.el7                 docker-ce.x86_64 3:19.03.8-3.el7                   
  docker-ce-cli.x86_64 1:24.0.3-1.el7                        docker-compose-plugin.x86_64 0:2.19.1-1.el7        

Updated:
  libselinux.x86_64 0:2.5-15.el7                              libselinux-python.x86_64 0:2.5-15.el7             
  libselinux-utils.x86_64 0:2.5-15.el7                        libsemanage.x86_64 0:2.5-14.el7                   
  libsemanage-python.x86_64 0:2.5-14.el7                      policycoreutils.x86_64 0:2.5-34.el7               
  policycoreutils-python.x86_64 0:2.5-34.el7                  selinux-policy.noarch 0:3.13.1-268.el7_9.2        
  selinux-policy-targeted.noarch 0:3.13.1-268.el7_9.2         setools-libs.x86_64 0:3.3.8-4.el7                 

Complete!

 查看dockers版本情况

[root@bogon docker]# docker version
Client: Docker Engine - Community
 Version:           24.0.3
 API version:       1.43
 Go version:        go1.20.5
 Git commit:        3713ee1
 Built:             Wed Jul  5 20:48:25 2023
 OS/Arch:           linux/amd64
 Context:           default
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

查看docker运行情况,发现没运行

[root@bogon docker]# sudo service docker status
Redirecting to /bin/systemctl status docker.service
鈼?docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: https://docs.docker.com

启动dockers:systemctl start docker

再次查看版本信息,dockers已启动文章来源地址https://www.toymoban.com/news/detail-770557.html

[root@bogon docker]# docker version
Client: Docker Engine - Community
 Version:           24.0.3
 API version:       1.40 (downgraded from 1.43)
 Go version:        go1.20.5
 Git commit:        3713ee1
 Built:             Wed Jul  5 20:48:25 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b
  Built:            Wed Mar 11 01:25:42 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

到了这里,关于Linux docker依赖离线安装的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 【运维】Linux 跨服务器复制文件文件夹

    如果是云服务 建议用内网ip scp是secure copy的简写,用于在Linux下进行远程拷贝文件的命令,和它类似的命令有cp,不过cp只是在本机进行拷贝不能跨服务器,而且scp传输是加密的。可能会稍微影响一下速度。当你服务器硬盘变为只读 read only system时,用scp可以帮你把文件移出来

    2024年02月08日
    浏览(74)
  • linux离线安装docker

    第一步:下载docker安装包:https://download.docker.com/linux/static/stable/x86_64/ 第二步:上传安装包至linux服务器: /opt/docker 第三步:解压docker安装包: tar -zxvf docker-20.10.0.tgz 第四步:将解压出来的docker文件夹,复制到/usr/bin目录下: cp docker/* /usr/bin/ 第五步:将docker.service文件,拷贝

    2024年02月07日
    浏览(40)
  • linux下离线安装docker

    一、安装docker Docker 官网离线安装文档 https://docs.docker.com/engine/install/binaries/ 整理步骤如下: 官网下载 docker 安装包,地址为 https://download.docker.com/linux/static/stable/,如果是x86就选择x86_64,arm选择aarch64,然后下载tgz包,这里选择的是目前的最新版24.0.5 在任意位置解压 移到 /us

    2024年02月13日
    浏览(53)
  • 【Linux 服务器运维】定时任务 crontab 详解 | 文末送书

    本文思维导图概述的主要内容: 1.1 什么是 crontab Crontab 是一个在 Unix 和 Linux 操作系统上 用于定时执行任务 的工具。它允许用户创建和管理计划任务,以便在特定的时间间隔或时间点自动运行命令或脚本。Crontab 是 cron table 的缩写, cron 指的是 Unix 系统中的一个后台进程,它

    2024年02月08日
    浏览(92)
  • 【Linux运维】shell脚本检查服务器内存和CPU利用率

    在管理服务器时候写了一个 shell脚本,在服务上实现每天凌晨3点查系统的指定文件夹下的容量大小,如果超过10G就要删除3天前的内容,还要时刻查询内存和cpu利用率,如果超过80%就要提示用户出现过载 将以上代码保存为一个.sh文件,然后通过crontab在每天凌晨3点运行即可:

    2024年02月09日
    浏览(67)
  • 【Linux】Centos 8 服务器部署:docker 安装 jdk、nginx、nacos、redis、Sentinel Dashboard

    目录 一、安装软件 (1)全部安装命令 (2)安装:jdk (3)安装:nginx  (4)安装:nacos (5)安装:redis (6)安装:Sentinel Dashboard 二、开放端口 三、启动软件  (1)启动:nacos (2)启动:nginx (3)启动:redis (4)启动:Sentinel Dashboard 四、访问网址  (1)访问:nacos 

    2024年02月06日
    浏览(65)
  • Linux离线环境安装部署docker(超详细)

    可以参考菜鸟教程:https://www.runoob.com/docker/centos-docker-install.html 安装插件 添加仓库地址: 安装指定版本的docker-ce和docker-ce-cli: 启动docker,设为开机自启动: docker-Linux下载地址 搭建docker环境准备 在能连网的服务器上下载所需的镜像,例如 上传docker压缩包及镜像上传到需要部署的服

    2024年02月03日
    浏览(59)
  • Linux离线安装Telnet服务

    安装过程概要:        (一)互联网端下载rpm包;         (二)上传到服务器root目录下; (三)安装telnet服务和测试: 详细内容: (一)互联网端下载rpm包;         安装telnet所需软件包:1、telnet-client   2、Telnet server   3、 xinetd 以下软件包下载地址: teln

    2024年02月13日
    浏览(40)
  • Linux Centos7内网服务器离线升级openssh9.3

    内网服务器需要升级openssh,被折磨了一整天,觉得有必要记录一下,不然对不起这差点崩溃的一天,主要的几个难点就是不能yum一键安装,需要自己找到对应的依赖版本然后通过堡垒机上传到内网,还有就是服务器很干净,什么都没有,需要离线安装的包太多,又不知道依赖

    2024年02月16日
    浏览(45)
  • Linux离线arm环境安装部署docker详细教程

    1、下载 通过官网下载docker安装包,找arm环境的安装包,如果是x86环境可以下载对应的安装包 Index of linux/static/stable/aarch64/ 2、上传到服务器上,通过rz命令 上传成功后解压 tar -xvf docker-24.0.6.tgz  3. 复制文件到 /usr/bin cp ./docker/* /usr/bin 4. 创建docker.service vim  /etc/systemd/system/doc

    2024年02月03日
    浏览(46)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包