linux离线安装docker

安装连接参考

docker离线安装部署详细步骤-CSDN博客

(1)安装包下载

根据机器架构选择x86_64或 aarch64 版本的docker安装包

Index of linux/static/stable/

(2)安装包解压

(3)复制文件

将docker中的全部文件,使用以下命令,复制到/usr/bin

cp ./docker/* /usr/bin

(4)创建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

ExecReload=/usr/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

(5) 添加执行权限

chmod +x docker.service

(6)执行docker检查

加载docker.service

systemctl daemon-reload

启动docker

systemctl start docker

查看docker

systemctl status docker

(7)开机自启动

systemctl enable docker.service

相关推荐
2301_801184752 小时前
linux系统注意知识
linux·运维·服务器
程序猿追3 小时前
换场倒计时的暂停、重置与到点回调在 HarmonyOS 7 上怎么处理
运维·服务器·数据库·harmonyos
小豆庄4 小时前
自动化内容分发的架构选型:自建脚本、外包还是工具平台?
运维·容器·架构·自动化·go·需求分析
天远API4 小时前
零信任架构实战:基于天远车辆过户详版查询构建自动化二手车残值估值网关
运维·人工智能·架构·自动化
丽丽的代码4 小时前
Docker 命令学习手册:从零接手一个容器化项目
学习·docker·容器
迈威通信4 小时前
MICF600S-2F工业CAN光纤转换器技术解析:光纤远传、环网自愈与云边协议互通
运维·网络·架构·信息与通信
LaughingZhu5 小时前
Product Hunt 热榜 2026-12-05:SoduWork、finerd split、Otari by Mozilla AI
java·人工智能·docker·chatgpt·容器
志栋智能7 小时前
超自动化安全的报告自动生成与分发
运维·安全·自动化
小敬爱吃饭8 小时前
PgHero轻量PostgreSQL监控:Docker部署、连接统计与执行计划
数据库·docker·postgresql
开开心心就好9 小时前
定时结束进程的小工具,到点还能关机
linux·运维·服务器·智能手机·pdf·电脑·word