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

相关推荐
心之王者7163 小时前
【Linux】多线程:从线程控制、同步互斥到经典并发模型
linux·运维·服务器
Doctor_Strange_DML3 小时前
图像编辑模型服务部署过程记录
linux·缓存·docker·ai
Decay__5 小时前
PostgreSQL 运维自动化平台 —— 部署编排、监控、巡检、告警、工单闭环一体化
运维·数据库·sql·mysql·架构
java_logo5 小时前
Docker 部署 Vaultwarden:轻松搭建私有化密码管理平台
运维·docker·容器·私有化部署·密码管理·轩辕镜像·密码管理软件
无足鸟ICT8 小时前
【RHCA+】_proc_pid_cmdline
linux·运维·服务器
饿了吃洗衣凝珠10 小时前
shell循环
linux·运维·服务器
木雷坞11 小时前
Docker 镜像源列表(11月30日更新-长期)
运维·docker·容器
迪康软件zz13 小时前
单向阀的代码:把"高级别解低级别"写成可测的判定
运维·安全·自动化运维
SeanQhl14 小时前
容器隔离与资源限制实操
容器·cgroup·openeuler·namespace·资源隔离
Diligently_14 小时前
docker 中的常见的使用命令(三)
运维·docker·容器