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

相关推荐
Danileaf_Guo6 小时前
256台H100服务器算力中心的带外管理网络建设方案
运维·服务器
拾贰_C7 小时前
【Linux | Windows | Terminal Command】 Linux---grep | Windows--- findstr
linux·运维·服务器
bloglin999998 小时前
启动容器报错ls: cannot access ‘/docker-entrypoint-initdb.d/‘: Operation not permitted
docker·容器·eureka
songjxin8 小时前
离线部署kubernetes v1.34.3
云原生·容器·kubernetes
虹科网络安全8 小时前
艾体宝洞察 | 利用“隐形字符”的钓鱼邮件:传统防御为何失效,AI安全意识培训如何补上最后一道防线
运维·网络·安全
石像鬼₧魂石9 小时前
Kali Linux 网络端口深度扫描
linux·运维·网络
alengan9 小时前
linux上面写python3日志服务器
linux·运维·服务器
yBmZlQzJ9 小时前
免费内网穿透-端口转发配置介绍
运维·经验分享·docker·容器·1024程序员节
JH30739 小时前
docker 新手入门:10分钟搞定基础使用
运维·docker·容器
小卒过河010410 小时前
使用apache nifi 从数据库文件表路径拉取远程文件至远程服务器目的地址
运维·服务器·数据库