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

    ===========所有内容均为本人学习所用,如有侵权问题请联系本人。=============== ======================但行好事 莫问前程========================
  • 相关阅读:
    关于xmlhttprequest的readystate属性的五个状态(转载)
    MySQL在windows下 1045 access denied for user 'root'@'localhost' using password yes 解决办法 (转)
    栈 堆
    代码安全问题
    TSQL 编程规范(摘自网络)
    UCenter 来自网络
    如何调试 asp 程序 摘自: http://hi.baidu.com/artmis_/blog/item/dd859df57c317b7edcc474f0.html
    《大话设计模式》6个原则 转帖
    SliverLight的bug OR Vs2008的bug?
    ifconfig
  • 原文地址:https://www.cnblogs.com/yhd-2018/p/12969727.html
Copyright © 2011-2022 走看看