• 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

    ===========所有内容均为本人学习所用,如有侵权问题请联系本人。=============== ======================但行好事 莫问前程========================
  • 相关阅读:
    【1】
    正则表达式 re模块
    模块—— 序列化模块、random模块、os模块 、 sys模块、hashlib模块、collections模块
    编码转换 文件的操作
    函数进阶3 —— 生成器、yield from
    函数的进阶2
    函数进阶 —— 动态参数、内置空间、函数嵌套
    初识函数 函数参数 三元运算
    Sringboot jdbc 操作数据库
    python使用subprocess执行linux命令
  • 原文地址:https://www.cnblogs.com/yhd-2018/p/12969727.html
Copyright © 2020-2023  润新知