当前位置: 首页 > news >正文

笔记 Docker(离线)安装(24.0.9)

1、解压

tar -xvf docker-24.0.9.tgz

2、将解压出来的docker文件内容移动到 /usr/bin/ 目录下

cp docker/* /usr/bin/

3、将docker注册为service

vim /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 -H unix:///var/run/docker.sock --selinux-enabled=false --default-ulimit nofile=65536:65536
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

4、启动

chmod +x /etc/systemd/system/docker.service #添加文件权限并启动docker

systemctl daemon-reload #重载unit配置文件

systemctl start docker #启动Docker

systemctl enable docker.service #设置开机自启

5、验证

systemctl status docker #查看Docker状态

docker -v #查看Docker版本

若需开启远程服务ExecStart属性修改为以下命令

ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --selinux-enabled=false --default-ulimit nofile=65536:65536 # -H tcp://0.0.0.0:2375 开启远程连接命令

http://www.dtcms.com/a/392220.html

相关文章:

  • Docker-Android+cpolar:移动开发的环境革命
  • uniapp首先对战匹配简单实现
  • [bitcoin白皮书_2] 隐私 | 计算
  • 【杂谈】-重构注意力经济:人工智能重塑短视频内容生态
  • 【杂谈】Godot 4.5下载指南
  • CICD工具选型,Jenkins VS Arbess哪一款更好用?
  • iOS 26 续航测试实战,如何测电池掉电、Adaptive Power 模式功耗、新系统更新后的耗电差异与 App 续航优化指南
  • 数据挖掘与KDD:从理论到实践的最佳流程解析
  • 深入理解Linux网络中的Socket网络套接字——基础概念与核心实现
  • Spark专题-第二部分:Spark SQL 入门(4)-算子介绍-Exchange
  • Spark专题-第二部分:Spark SQL 入门(3)-算子介绍-Aggregate
  • Go基础:Go语言中集合详解(包括:数组、切片、Map、列表等)
  • 《算法闯关指南:优选算法--滑动窗口》--09长度最小的子数串,10无重复字符的最长字串
  • 请卸载xshell,一款国产的终端工具,界面漂亮,功能强大,支持win,mac,linux平台,安全免费
  • 用批处理文件实现Excel和word文件的重造
  • unseping(反序列化漏洞)
  • 麒麟系统 word转为pdf
  • 【Codex CLI 配置指南(小白速通版)】
  • R及RStudio的配置与安装
  • 深度解析:基于 ODBC连接 KingbaseES 数据库的完整操作与实践
  • springboot川剧科普平台(代码+数据库+LW)
  • Vue中的监听方式
  • CentOS 7系统解决yum报错
  • GD32VW553-IOT V2开发版【温湿度检测】
  • Perplexica - 开源AI搜索引擎,让搜索更智能
  • Windows在VSCode Cline中安装Promptx
  • 深入解析 Spring AI 系列:解析返回参数处理
  • LeetCode:34.合并K个升序链表
  • 精细化关键词优化:提升SEO效果的长尾策略解析
  • Go基础:Go语言详细介绍,环境搭建,及第一个程序详解