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

相关推荐
w3296362712 小时前
八、OpenCode 高阶玩法:CLI 自动化、CI/CD 集成与远程协作
运维·ci/cd·自动化·ai编程·开发工具·opencode
隐层漫游者2 小时前
2026全网最细Docker容器化实战!从安装配置到Milvus向量数据库部署,一文掌握核心精髓(建议收藏)
docker
烁3472 小时前
liunx命令不完整版
linux·运维·服务器
vsropy2 小时前
cmake版本不对不能直接删/无法source
linux·运维·服务器
Esaka_Forever3 小时前
Zapier 云端无代码 AI 工作流编排自动化平台
运维·自动化
c238563 小时前
git常见错误和ssh验证推送
运维·git·ssh
哈德森hh3 小时前
从手动操作到自动化管理:Twitter多账号运营效率优化实践
运维·自动化·twitter
IT WorryFree3 小时前
ESXi 全维度监控方式完整分类(按使用场景排序)
运维·服务器·网络
专注搞钱4 小时前
FAB设备OEE自动化分析工具:月度报表从2天缩短到30秒
运维·自动化
加加and减减4 小时前
Docker真实安装mysql8教程并优化配置
运维·mysql·docker·容器