• 【docker】docker 、docker-compose离线安装


    一、离线安装docker

    docker、docker-compose 百度盘

    链接:https://pan.baidu.com/s/1eME67PmV8HzpgtfCHVU-pA 
    提取码:t8d4 
    链接:https://pan.baidu.com/s/1eMwepKEH3-QBlTFYVqqtwQ 
    提取码:19vc 
    --来自百度网盘超级会员V3的分享
    
    • 1
    • 2
    • 3
    • 4
    • 5

    1. 下载docker安装包

    官方地址:

    https://download.docker.com/linux/static/stable/x86_64/docker-20.10.9.tgz

    2.解压缩

    tar -zxvf docker-20.10.9.tgz

    [root@centos247 docker]# tar -zxvf docker-20.10.9.tgz 
    docker/
    docker/containerd-shim-runc-v2
    docker/dockerd
    docker/docker-proxy
    docker/ctr
    docker/docker
    docker/runc
    docker/containerd-shim
    docker/docker-init
    docker/containerd
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    3. 解压的docker文件夹全部移至/usr/bin目录

    cp -p docker/* /usr/bin

    4. 将docker注册为系统服务

    ① 在/usr/lib/systemd/system/目录下,创建docker.service文件
    ② 编辑docker.service文件

    vim /usr/lib/systemd/system/docker.service

    [Unit]
    Description=Docker Application Container Engine
    Documentation=http://docs.docker.com
    After=network.target docker.socket
    [Service]
    Type=notify
    EnvironmentFile=-/run/flannel/docker
    WorkingDirectory=/usr/local/bin
    ExecStart=/usr/bin/dockerd \
                    -H tcp://0.0.0.0:4243 \
                    -H unix:///var/run/docker.sock \
                    --selinux-enabled=false \
                    --log-opt max-size=1g
    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=on-failure
    [Install]
    WantedBy=multi-user.target
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30

    5. 重启生效

    重启守护进程
    systemctl daemon-reload
    systemctl start docker
    查看docker状态
    systemctl status docker
    设置开机启动
    systemctl enable docker
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    查看版本 docker version

    [root@centos247 docker]# docker version
    Client: Docker Engine - Community
     Version:           20.10.17
     API version:       1.41
     Go version:        go1.17.11
     Git commit:        100c701
     Built:             Mon Jun  6 23:05:12 2022
     OS/Arch:           linux/amd64
     Context:           default
     Experimental:      true
    
    Server: Docker Engine - Community
     Engine:
      Version:          20.10.9
      API version:      1.41 (minimum version 1.12)
      Go version:       go1.16.8
      Git commit:       79ea9d3
      Built:            Mon Oct  4 16:06:37 2021
      OS/Arch:          linux/amd64
      Experimental:     false
     containerd:
      Version:          1.6.6
      GitCommit:        10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
     runc:
      Version:          1.1.2
      GitCommit:        v1.1.2-0-ga916309
     docker-init:
      Version:          0.19.0
      GitCommit:        de40ad0
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29

    二、离线安装docker-compose

    1. 下载docker-compose

    官方地址:

    https://github.com/docker/compose/releases/download/v2.2.2/docker-compose-linux-x86_64

    2.安装

    sudo mv docker-compose-Linux-x86_64 /usr/local/bin/docker-compose
    sudo chmod +x /usr/local/bin/docker-compose
    docker-compose -v
    
    • 1
    • 2
    • 3

    查看版本 docker-compose version

    [root@centos247 docker]# docker-compose version
    docker-compose version 1.24.1, build 4667896b
    docker-py version: 3.7.3
    CPython version: 3.6.8
    OpenSSL version: OpenSSL 1.1.0j  20 Nov 2018
    
    • 1
    • 2
    • 3
    • 4
    • 5
  • 相关阅读:
    Pytorch或Tensorflow 深度学习库安装 (简易版)
    RAR压缩包如何加密,忘记密码如何找回?
    前端(二十一)——WebSocket:实现实时双向数据传输的Web通信协议
    当服务器有可视化界面,直接起飞!
    企业数字化转型建设过程中需要哪些能力?
    缓存学习总结4(分布式缓存)
    前言技术 VScode + 其他插件-2
    设计模式之工厂模式(学习笔记)
    深度学习与神经网络入门
    Response响应对象
  • 原文地址:https://blog.csdn.net/qq_28392947/article/details/126156173