离线安装docker和docker-compose

1.下载

docker

Index of linux/static/stable/x86_64/

docker-compose

Overview of installing Docker Compose | Docker Docs

2.docker

/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=/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
bash 复制代码
[root@localhost opt]# tar -zxvf docker-23.0.6.tgz 
docker/
docker/docker-proxy
docker/containerd-shim-runc-v2
docker/ctr
docker/docker
docker/docker-init
docker/runc
docker/dockerd
docker/containerd
[root@localhost opt]# ls
docker  docker-23.0.6.tgz  docker-compose-linux-x86_64  rh
[root@localhost opt]# cp docker/* /usr/bin/
[root@localhost opt]# cd /
[root@localhost /]# vi /etc/systemd/system/docker.service
[root@localhost /]# chmod +x /etc/systemd/system/docker.service
[root@localhost /]# systemctl daemon-reload
[root@localhost /]# systemctl start docker
[root@localhost /]# systemctl enable docker.service
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /etc/systemd/system/docker.service.
[root@localhost /]# docker -v
Docker version 23.0.6, build ef23cbc

3.docker-compose

bash 复制代码
[root@localhost opt]#  mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
[root@localhost opt]# chmod +x /usr/local/bin/docker-compose
[root@localhost opt]# docker-compose -v
Docker Compose version v2.5.0
相关推荐
xbzb1 天前
Kubernetes 节点删除后还有残留?drain、reset 与集群销毁重建全流程
容器·kubernetes·kubectl·集群·reset·drain
正在走向自律1 天前
Infra 现代研发基础设施实战:从 IaC、K8s 到平台工程与可观测性
云原生·容器·kubernetes·terraform·github actions·infra
AI开源软件1 天前
Kubernetes 网络实战:打通 Pod、Service 与集群外任务调度器的双向调用
docker·nacos·kubernetes·xxl-job·calico·微服务部署·ruoyi office
csdn_aspnet1 天前
Docker 啟動MySQL Server連上MySQL Workbench
mysql·docker·容器
月夏1 天前
我把全栈项目塞进已有 nginx 的服务器,卡我最久的是三个斜杠
nginx·react.js·docker
瑞克-桑切斯2 天前
Kubernetes 1.28 保姆级新手学习教程
运维·学习·docker·云原生·容器·kubernetes
对象存储与RustFS2 天前
对象锁遇上版本化:删掉的对象还在,真删的又删不掉
后端·docker·云原生
遇雪长安2 天前
wslc 来了:Docker Desktop 还要留着吗?
运维·docker·容器
csdn_aspnet2 天前
【Docker 攻略】MySQL 安裝篇
运维·mysql·docker·容器
艺杯羹2 天前
ufw 已 active,Docker 端口却仍对外开放的复盘
运维·docker·容器