redhat安装docker 24.0.7

1、下载docker镜像包

wget https://download.docker.com/linux/static/stable/x86_64/docker-24.0.7.tgz

2、解压

tar -xvf docker-24.0.7.tgz

3、解压的docker文件夹全部移动至/usr/bin目录

cd docker

cp -p docker/* /usr/bin

4、注册服务

vi /usr/lib/systemd/system/docker.service

添加 下面内容

Unit

Description=Docker Application Container Engine

Documentation=http://docs.docker.com

After=network.target docker.socket

Service

Type=notify

EnvironmentFile=-/run/flannel/docker

WorkingDirectory=/usr/local/bin

ExecStart=/usr/bin/dockerd \

-H tcp://0.0.0.0:4243 \

-H unix:///var/run/docker.sock \

--selinux-enabled=false \

--log-opt max-size=1g

ExecReload=/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=on-failure

Install

WantedBy=multi-user.target

5、重启守护进程

systemctl daemon-reload

systemctl start docker

systemctl enable docker

6、检查docker服务是否正常

systemctl status docker

相关推荐
Trouvaille ~24 分钟前
【Linux】网络编程基础(二):数据封装与网络传输流程
linux·运维·服务器·网络·c++·tcp/ip·通信
久绊A1 小时前
春节前云平台运维深度巡检-实操经验
运维·安全·容器·kubernetes·云平台
梦想的旅途21 小时前
企业微信API外部群自动化推送:从“群发工具”到“智能触达”的架构实践
运维·自动化·企业微信
feasibility.2 小时前
在OpenCode使用skills搭建基于LLM的dify工作流
人工智能·低代码·docker·ollama·skills·opencode·智能体/工作流
yuezhilangniao2 小时前
Next.js 项目运维手册-含-常用命令-常见场景
运维·开发语言·reactjs
!chen2 小时前
银河麒麟v11 kubeadm部署k8s v1.35.0高可用集群
云原生·容器·kubernetes
DB!!!2 小时前
自学Kubernestes(k8s)Day1 -- 核心基础概念
云原生·容器·kubernetes
Trouvaille ~2 小时前
【Linux】网络编程基础(三):Socket编程预备知识
linux·运维·服务器·网络·c++·socket·网络字节序
lpruoyu2 小时前
【Docker进阶-02】Docker命令
docker·容器
德迅云安全—珍珍3 小时前
低配服务器性能不够用怎么去优化?
运维·服务器