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

相关推荐
xiaoliuliu1234522 分钟前
Xshell-7.0.0111p安装步骤详解(附SSH连接与远程命令教程)
运维·ssh
gaize121328 分钟前
服务器是什么?用来做什么?基本属性有什么?如何配置和挑选?
运维·服务器
谢斯1 小时前
[AFFine]文档系统,docker搭建
运维·docker·容器
qq_297815271 小时前
Docker Compose 部署 RocketMQ 5.4.0 完整指南(Windows Docker Desktop 专属)
windows·docker·rocketmq
SakitamaX3 小时前
LVS(Linux virual server)介绍与实验
linux·运维·lvs
小义_3 小时前
【Docker】知识八
linux·docker·云原生
开开心心_Every3 小时前
CDR版本转换工具,支持多版本互转免升级软件
linux·运维·服务器·云原生·edge·pdf·serverless
暴力求解5 小时前
Linux--进程(四) 进程优先级与进程切换
linux·运维·服务器
Laughtin6 小时前
【Claude Code】如何删除git提交时的AI署名
运维·服务器