docker离线和在线安装

发布时间:2026/9/23 11:47:51

docker离线和在线安装 一.docker环境1.在线安装###########centos在线安装############# #1.更新yum源 wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo yum clean all yum makecache #2.添加docker国内镜像源 yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo #3.安装docker yum -y install docker-ce docker-ce-cli containerd.io ##########ubuntu在线安装######### apt install -y docker.io2.离线安装#1.自己准备docker离线包本文自带 dockerBin.zip #2.解压移动文件 unzip dockerBin.zip cp ./docker/* /usr/bin/ #启动程序 cp ./docker/docker.service /etc/systemd/system #开机自启文件末尾有第4小节 #3.启动docker、开机自启、查看docker启动状态 systemctl daemon-reload #重新加载systemctl文件 systemctl start docker systemctl enable docker systemctl status docker #4.docker.service文件如下 cat docker.service [Unit] DescriptionDocker Application Container Engine Documentationhttps://docs.docker.com # BindsTocontainerd.service Afternetwork-online.target firewalld.service # containerd.service Wantsnetwork-online.target # Requiresdocker.socket [Service] Typenotify # 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 EnvironmentFile-/etc/sysconfig/docker EnvironmentFile-/etc/sysconfig/docker-storage EnvironmentFile-/etc/sysconfig/docker-network EnvironmentGOTRACEBACKcrash ExecStart/usr/bin/dockerd $OPTIONS \ $DOCKER_STORAGE_OPTIONS \ $DOCKER_NETWORK_OPTIONS \ $INSECURE_REGISTRY # -H fd:// --containerd/run/containerd/containerd.sock ExecReload/bin/kill -s HUP $MAINPID TimeoutSec0 RestartSec2 Restartalways # Note that StartLimit* options were moved from Service to Unit in systemd 229. # Both the old, and new location are accepted by systemd 229 and up, so using the old location # to make them work for either version of systemd. StartLimitBurst3 # Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230. # Both the old, and new name are accepted by systemd 230 and up, so using the old name to make # this option work for either version of systemd. StartLimitInterval60s # Having non-zero Limit*s causes performance problems due to accounting overhead # in the kernel. We recommend using cgroups to do container-local accounting. LimitNOFILEinfinity LimitNPROCinfinity LimitCOREinfinity # Comment TasksMax if your systemd version does not support it. # Only systemd 226 and above support this option. TasksMaxinfinity # set delegate yes so that systemd does not reset the cgroups of docker containers Delegateyes # kill only the docker process, not all processes in the cgroup KillModeprocess [Install] WantedBymulti-user.target3.docker镜像加速配置#编写/etc/docker/daemon.json配置文件 #1.基础版本完全够用 tee /etc/docker/daemon.json -EOF { registry-mirrors: [https://ej3odski.mirror.aliyuncs.com] } EOF #2.不理解不要配 tee /etc/docker/daemon.json -EOF { log-driver: json-file, log-opts: { max-size: 100m, max-file: 3 }, exec-opts: [native.cgroupdriversystemd], storage-driver: overlay2, storage-opts: [ overlay2.override_kernel_checktrue ], registry-mirrors: [ https://docker.mirrors.ustc.edu.cn, https://hub-mirror.c.163.com ] } EOF #注意配置文件更新后需要重启docker systemctl restart docker
延伸阅读

更多相关文章

2026/9/23 11:47:02

5分钟掌握微信批量消息发送:解放双手的自动化神器

5分钟掌握微信批量消息发送:解放双手的自动化神器 【免费下载链接】WeChat-mass-msg 微信自动发送信息,微信群发消息,Windows系统微信客户端(PC端 项目地址: https://gitcode.com/gh_mirrors/we/WeChat-mass-msg 还在为给上…

2026/9/19 21:47:08

melonDS开源模拟器终极指南:快速上手任天堂DS游戏模拟

melonDS开源模拟器终极指南:快速上手任天堂DS游戏模拟 【免费下载链接】melonDS DS emulator, sorta 项目地址: https://gitcode.com/gh_mirrors/me/melonDS 想要在电脑上重温经典的任天堂DS游戏吗?melonDS开源模拟器是你的完美选择!这…

2026/9/23 11:43:19

培训班如何招生背后的性能优化:源码级拆解

培训班如何招生背后的性能优化:源码级拆解 面试被问原理答不上来,那种大脑空白的尴尬,比招不到学员更让人窒息。很多做培训的朋友,把【培训班如何招生】当成纯运营活儿,觉得发传单、搞地推就行。其实,当你的咨询量破千、并发报名激增时,系统卡死才是生…

2026/9/23 11:38:19

qci新手避坑指南:5个核心优化点让性能提升3倍

qci新手避坑指南:5个核心优化点让性能提升3倍 复制来的代码跑不通,盯着报错信息发呆,不知道从哪开始调?这种“黑盒”调试体验是每个新手在性能优化路上的噩梦。很多教程只给最终代码,却不讲为什么这么写,导致你面对 qci (Query…

2026/9/22 10:02:42

GAMP 5 基于风险的计算机化系统验证:软件分类与审计追踪实践

简介:《A Risk-Based Approach to Compliant GxP Computerized Systems》即业内熟知的GAMP 5指南,面向制药企业质量与IT合规人员、验证工程师及计算机化系统管理者,用于解决GxP法规环境下系统合规性难以科学落地的问题。文档以风险管理为主线…

2026/9/22 9:07:39

安全托管MSSP实战:从静态防御到人机协同的攻防运营与应急响应

简介:这份PPT围绕互联网业务安全托管服务展开,面向企业安全负责人、IT运维人员及关注MSSP/MSS选型的读者,重点回应传统安全过度依赖人工、碎片化静态防御难以对抗产业化攻击等痛点。资源共1个pptx文件,包体约30.63MB,以…

2026/9/23 0:01:54

3个实战技巧搞定形式英语:从看教程到跑通性能优化

3个实战技巧搞定形式英语:从看教程到跑通性能优化 看了一堆教程还是不会写项目?别慌,这种“眼高手低”的困境在开发者圈子里太常见了。很多人以为卡点在语法,其实真正拦路虎是缺乏将知识点串联成完整链路的能力。今天咱们不聊虚的,直接拿【形式英语】这…

2026/9/22 16:34:32

USB Type-C PCB布局分区设计:电源、高速信号与PD协议全攻略

做硬件这行,Type-C接口算是典型的“看着简单,做起来全坑”的东西。光引脚就24个,高低速信号、电源、控制线全部塞在一个小小的连接器里,如果PCB布局不做规划,打样回来基本就是“插上没反应”、“高速掉线”、“静电一打…

2026/9/22 20:01:30

系统编程学习原型如何补齐稳定性边界

系统编程学习原型如何补齐稳定性边界预算有限时&#xff0c;我先优化明显多余的复制&#xff0c;而不是猜测性地换容器。用借用传递只读数据通常就能减少分配&#xff1a; fn parse(line: &str) -> Result<Item, Error> { /* ... */ }用基准确认热点确实在分配&am…

2026/9/22 13:25:41

雨花区哪家财务公司代理记账比较好?

在雨花区&#xff0c;企业处理财税事务常常面临诸多挑战&#xff0c;选择一家靠谱的财务公司至关重要。湖南巨勤财务管理咨询有限公司就是本地正规实体财税服务机构&#xff0c;深耕本地工商财税行业多年&#xff0c;熟悉当地工商局、税务局最新政策与申报流程。主营公司注册、…

还想了解更多?直接咨询顾问

免费诊断 + 免费方案 + 透明报价。

全国咨询热线400-8866-253
免费获取方案
咨询二维码