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

相关推荐
susu10830189112 分钟前
Ubuntu 离线环境 安装 Docker Compose
运维·docker·容器
要开心吖ZSH5 分钟前
(三)OpenClaw 云端服务器控制本地 Windows 浏览器完整配置指南(SSH方式)
运维·服务器·windows·openclaw
研究点啥好呢13 分钟前
3月10日GitHub热门项目推荐|自动化的浪潮
运维·人工智能·ai·自动化·github
fengyehongWorld19 分钟前
docker compose的使用
运维·docker·容器
七夜zippoe20 分钟前
Docker容器化实战:核心概念、镜像制作与多阶段构建全解析
java·jvm·数据库·docker·oracle·容器化
进击切图仔21 分钟前
linux 虚拟文件系统简介和详解
linux·运维·服务器
跟着珅聪学java26 分钟前
Electron 精美菜单设计
运维·前端·数据库
虾..1 小时前
Linux 网络套接字编程
linux·运维·网络
ai产品老杨1 小时前
源码交付破局异构算力:基于GB28181/RTSP与Docker的AI视频平台架构实战
人工智能·docker·音视频
熬夜有啥好1 小时前
Linux软件编程——TCP并发服务器
运维·服务器