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

相关推荐
万米商云8 分钟前
企业物资集采平台解决方案:跨地域、多仓库、百部门——大型企业如何用一套系统管好百万级物资?
大数据·运维·人工智能
i小溪17 分钟前
在使用 Docker 时,如果容器挂载的数据目录(如 `/var/moments`)位于数据盘,只要服务没有读写,数据盘是否就不会被唤醒?
人工智能·docker
挑战者66688840 分钟前
CentOS 系统高效部署 Dify 全攻略
linux·运维·centos
网硕互联的小客服2 小时前
服务器经常出现蓝屏是什么原因导致的?如何排查和修复?
运维·服务器·stm32·单片机·网络安全
喜欢吃豆2 小时前
从零构建MCP服务器:FastMCP实战指南
运维·服务器·人工智能·python·大模型·mcp
海外空间恒创科技2 小时前
恒创科技:香港站群服务器做seo站群优化效果如何
运维·服务器·科技
搬码临时工2 小时前
内网服务器怎么设置公网远程访问? windows桌面连接和Linux自带SSH外网异地跨网用完整步骤教程
运维·服务器·ssh
Rudon滨海渔村2 小时前
解决阿里云ubuntu内存溢出导致vps死机无法访问 - 永久性增加ubuntu的swap空间 - 阿里云Linux实例内存溢出(OOM)问题修复方案
linux·运维·ubuntu
苹果醋33 小时前
Vue3组合式API应用:状态共享与逻辑复用最佳实践
java·运维·spring boot·mysql·nginx
A-刘晨阳3 小时前
【Linux】Redis 6.2.6 的二进制部署【适用于多版本】
linux·运维·redis