• Docker 离线版安装


    首先、 下载 docker-20.10.9.tgz 和 docker-compose

    https://download.csdn.net/download/cyw8998/88905939

    一、离线安装docker
    1.解压缩

    docker-20.10.9.tgz

    1. [root@centos247 docker]# tar -zxvf docker-20.10.9.tgz
    2. docker/
    3. docker/containerd-shim-runc-v2
    4. docker/dockerd
    5. docker/docker-proxy
    6. docker/ctr
    7. docker/docker
    8. docker/runc
    9. docker/containerd-shim
    10. docker/docker-init
    11. docker/containerd
    2. 解压的docker文件夹全部移至/usr/bin目录
    cp -p docker/* /usr/bin
    3. 将docker注册为系统服务

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

    vim /usr/lib/systemd/system/docker.service
    1. [Unit]
    2. Description=Docker Application Container Engine
    3. Documentation=https://docs.docker.com
    4. After=network-online.target docker.socket firewalld.service containerd.service time-set.target
    5. Wants=network-online.target containerd.service
    6. [Service]
    7. Type=notify
    8. # the default is not to use systemd for cgroups because the delegate issues still
    9. # exists and systemd currently does not support the cgroup feature set required
    10. # for containers run by docker
    11. ExecStart=/usr/bin/dockerd
    12. ExecReload=/bin/kill -s HUP $MAINPID
    13. TimeoutStartSec=0
    14. RestartSec=2
    15. Restart=always
    16. # Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229.
    17. # Both the old, and new location are accepted by systemd 229 and up, so using the old location
    18. # to make them work for either version of systemd.
    19. StartLimitBurst=3
    20. # Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230.
    21. # Both the old, and new name are accepted by systemd 230 and up, so using the old name to make
    22. # this option work for either version of systemd.
    23. StartLimitInterval=60s
    24. # Having non-zero Limit*s causes performance problems due to accounting overhead
    25. # in the kernel. We recommend using cgroups to do container-local accounting.
    26. LimitNOFILE=infinity
    27. LimitNPROC=infinity
    28. LimitCORE=infinity
    29. # Comment TasksMax if your systemd version does not support it.
    30. # Only systemd 226 and above support this option.
    31. TasksMax=infinity
    32. # set delegate yes so that systemd does not reset the cgroups of docker containers
    33. Delegate=yes
    34. # kill only the docker process, not all processes in the cgroup
    35. KillMode=process
    36. OOMScoreAdjust=-500
    37. [Install]
    38. WantedBy=multi-user.target
    4. 重启生效
    1. 重启守护进程
    2. systemctl daemon-reload
    3. systemctl start docker
    4. 查看docker状态
    5. systemctl status docker
    6. 设置开机启动
    7. systemctl enable docker

    查看版本 docker version

    二、离线安装docker-compose

    1.安装

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

    2.看版本查

    docker-compose version

  • 相关阅读:
    一个由登录接口引发的思考
    西安博物院重现1000年前唐三彩,竟然是3D打印!
    oracle登录及基本操作
    深入理解JNINativeInterface函数<三>
    接口面试题
    送分题,ArrayList 的扩容机制了解吗?
    使用树莓派搭建个人网站,并发布到外网可访问:实用步骤解析
    微信小程序对接发货功能
    制作一个简单HTML校园网页(HTML+CSS)学校网站制作 校园网站设计与实现
    【使用jquery编写第一个油猴(tempermonkey)脚本】
  • 原文地址:https://blog.csdn.net/cyw8998/article/details/136446347