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

相关推荐
ShiXZ21333 分钟前
Docker 安装 Elasticsearch 7.17.6 完整教程
elasticsearch·docker·容器
云泽8081 小时前
Linux基础开发工具(三):Vim高级配置、Swap恢复机制与Sudo权限白名单详解
linux·运维·vim
Urbano1 小时前
服装厂入局自动化开袋设备:市场前景、机型选型与落地实效科普
运维·自动化
tju23331 小时前
Gitee Test是什么:从测试资产管理到自动化执行的工程化实践
运维·gitee·自动化
名字还没想好☜1 小时前
Kubernetes Pod 调度实战:nodeSelector、亲和性与 taint/toleration 把 Pod 放到指定节点
运维·云原生·容器·kubernetes·调度
qetfw1 小时前
CentOS 7 vsftpd.conf 配置文件详解:监听、用户、权限、被动模式与 TLS
linux·运维·centos·ftp·vsftpd
念何架构之路1 小时前
moby-BuildKit(builder-next)
学习·docker·容器
风曦Kisaki2 小时前
Kubernetes(K8s)笔记Day04:控制器(ReplicaSet 与Deployment),滚动更新及回滚,滚动更新策略,Pod 的 DNS 策略
linux·运维·笔记·docker·容器·kubernetes
薛定e的猫咪2 小时前
零基础选型指南:Make / 扣子 Coze/n8n/Dify 四大自动化平台完整对比
运维·自动化
张忠琳2 小时前
【NVIDIA】k8s-device-plugin v0.19.3 辅助命令模块深度分析之七
云原生·容器·架构·kubernetes·nvidia