Docker 安装利用

  金牌会员 | 2024-10-23 11:29:15 | 显示全部楼层 | 阅读模式
打印 上一主题 下一主题

主题 870|帖子 870|积分 2610

1. 下载
        下载地址:Index of linux/static/stable/x86_64/

下载好后,将文件docker-18.06.3-ce.tgz用WinSCP等工具,上传到不能外网的linux系统服务器
2. 安装
解压后的文件夹docker中文件如下所示:

将docker中的全部文件,利用下边命令,复制到/usr/bin
  1. cp ./docker/* /usr/bin
复制代码
创建docker.service文件

  1. cd /etc/systemd/system/
  2. touch docker.service
复制代码
编辑docker.service文件

注意,将其中的ip地址,改成您的服务器地址,其它参数不用改。
--insecure-registry=192.168.205.230
  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=192.168.205.230
  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
复制代码
添加可执行权限

  1. chmod +x docker.service
复制代码
加载docker.service (注意,若修改了docker.service文件,则要重新加载该文件)

  1. systemctl daemon-reload
复制代码
启动docker

  1. systemctl status docker
复制代码
查看docker



设置开机自启动

  1. systemctl enable docker.service
复制代码



免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

金牌会员
这个人很懒什么都没写!
快速回复 返回顶部 返回列表