zoukankan      html  css  js  c++  java
  • Docker最新版本离线安装

    1.RPM安装方式

    前提:拥有一台连接网络的Linux主机

    1.更新yum:yum update

    2.下载docker yum源:yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

    3.按版本降序列出docker: yum list docker-ce --showduplicates | sort -r

     

     4.下载最新版本Docker所需依赖包: yum install --downloaddir=/root/tmp/ --downloadonly docker-ce:20.10.6

     

    5.进入/root/tmp下安装所有依赖包: rpm -Uvh *.rpm

    6.查看docker版本 docker -v

    tgz方式安装

    1.下载最新的tgz包:https://download.docker.com/linux/static/stable/x86_64/

      

     2.上传到服务器并解压:tar -zxvf XXX.tgz

    3.将解压文件复制到 /usr/bin/ 目录:cp docker/* /usr/bin/

    4.进入目录:cd /etc/systemd/system/创建文件docker.service,内容如下:

    [Unit]
    Description=Docker Application Container Engine
    Documentation=https://docs.docker.com
    After=network-online.target firewalld.service
    Wants=network-online.target
    [Service]
    Type=notify
    # the default is not to use systemd for cgroups because the delegate issues still
    # exists and systemd currently does not support the cgroup feature set required
    # for containers run by docker
    ExecStart=/usr/bin/dockerd
    ExecReload=/bin/kill -s HUP $MAINPID
    # Having non-zero Limit*s causes performance problems due to accounting overhead
    # in the kernel. We recommend using cgroups to do container-local accounting.
    LimitNOFILE=infinity
    LimitNPROC=infinity
    LimitCORE=infinity
    # Uncomment TasksMax if your systemd version supports it.
    # Only systemd 226 and above support this version.
    #TasksMax=infinity
    TimeoutStartSec=0
    # set delegate yes so that systemd does not reset the cgroups of docker containers
    Delegate=yes
    # kill only the docker process, not all processes in the cgroup
    KillMode=process
    # restart the docker process if it exits prematurely
    Restart=on-failure
    StartLimitBurst=3
    StartLimitInterval=60s
    [Install]
    WantedBy=multi-user.target
    

    5.docker.service添加执行权限:chmod +x docker.service

    6.重新加载配置文件:docker.service(每次修改docker.service都需要重新加载)

    7.启动:systemctl start docker

    8.查看:systemctl status docker

    ===========所有内容均为本人学习所用,如有侵权问题请联系本人。=============== ======================但行好事 莫问前程========================
  • 相关阅读:
    gThumb 3.1.2 发布,支持 WebP 图像
    航空例行天气预报解析 metaf2xml
    Baruwa 1.1.2 发布,邮件监控系统
    Bisect 1.3 发布,Caml 代码覆盖测试
    MoonScript 0.2.2 发布,基于 Lua 的脚本语言
    Varnish 入门
    快速增量备份程序 DeltaCopy
    恢复模糊的图像 SmartDeblur
    Cairo 1.12.8 发布,向量图形会图库
    iText 5.3.4 发布,Java 的 PDF 开发包
  • 原文地址:https://www.cnblogs.com/yhd-2018/p/12969727.html
Copyright © 2011-2022 走看看