当前位置:   article > 正文

docker离线配置安装_docker离线安装指定配置文件dockerd-config

docker离线安装指定配置文件dockerd-config

一、CentOS 7

1、下载docker安装包:Index of linux/static/stable/x86_64/

2、将安装包随便放到系统某个目录下解压:tar -xvf docker-20.10.8.tgz

3、将解压后的docker目录中的所有内容拷贝到/usr/bin/目录下,放到此目录下相当于配置了环境变量即可以使用docker命令。(注:此处拷贝的内容不是整个docker目录而是docker目录下的所有文件

4、将docker注册为service:vim /etc/systemd/system/docker.service

  1. [Unit]
  2. Description=Docker Application Container Engine
  3. Documentation=https://docs.docker.com
  4. After=network-online.target firewalld.service
  5. Wants=network-online.target
  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 --selinux-enabled=false --insecure-registry=127.0.0.1
  12. ExecReload=/bin/kill -s HUP $MAINPID
  13. # Having non-zero Limit*s causes performance problems due to accounting overhead
  14. # in the kernel. We recommend using cgroups to do container-local accounting.
  15. LimitNOFILE=infinity
  16. LimitNPROC=infinity
  17. LimitCORE=infinity
  18. # Uncomment TasksMax if your systemd version supports it.
  19. # Only systemd 226 and above support this version.
  20. #TasksMax=infinity
  21. TimeoutStartSec=0
  22. # set delegate yes so that systemd does not reset the cgroups of docker containers
  23. Delegate=yes
  24. # kill only the docker process, not all processes in the cgroup
  25. KillMode=process
  26. # restart the docker process if it exits prematurely
  27. Restart=on-failure
  28. StartLimitBurst=3
  29. StartLimitInterval=60s
  30. [Install]
  31. WantedBy=multi-user.target

5、保存后给docker.service文件添加权限:chmod +x /etc/systemd/system/docker.service

6、重新加载配置文件(修改docker.service文件时都要重新加载下):systemctl daemon-reload

7、启动docker:systemctl start docker

8、设置开机启动:systemctl enable docker.service

9、查看docker状态:systemctl status docker

 10、查看docker版本:docker -v

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/代码探险家/article/detail/970566
推荐阅读
相关标签
  

闽ICP备14008679号