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

相关推荐
你看我名字30 分钟前
LNMP 生产架构与云运维实践:Nginx、PHP-FPM、MySQL 全链路分析
运维·nginx·架构
天远Date Lab38 分钟前
零信任架构实战:基于天远车辆估值构建自动化品牌二手车置换智能定价与补贴测算网关
运维·人工智能·架构·自动化
flytalei1 小时前
从 Jenkins 到 Argo CD:搭建一条完整的 GitOps 实战链路
运维·jenkins
张文君2 小时前
vmware克隆后ubuntu26.04 ip怎么更改
linux·运维·服务器
迪康coolmu2 小时前
基于迪康端点安全一体化管理系统的 AI 工具使用审计实战
运维·网络·人工智能·安全·电脑
Brilliantwxx3 小时前
【Linux】基础IO(下):输出重定向、dup2 与 minishell 重定向实战
linux·运维·服务器·github·bash
小HANN3 小时前
(架构 + InnoDB 事务 MVCC):《MySQL 底层探秘①:拆解 InnoDB,读懂事务、MVCC 与日志的底层逻辑》
linux·运维·服务器·经验分享
kyle~3 小时前
Linux --- 虚拟内存 1.fork、2.COW、3.mmap、4.page fault、5.TLB、6.页表
linux·运维·服务器
你看我名字3 小时前
LAMP 架构演练:从云主机准备到 Apache、PHP、MySQL 上线验证
运维·ci/cd·架构·kubernetes·jenkins
小HANN3 小时前
Ceph分布式存储深度解析-下篇
linux·运维·服务器·经验分享