离线安装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
相关推荐
L0208246 小时前
Kubernetes Ingress|CNI 网络模型|Calico 网络策略|Pod 调度器完整实战教程
运维·网络·云原生·容器·kubernetes
吴声子夜歌8 小时前
Kubernetes权威指南——Kubernetes安装配置指南(网络配置)
网络·容器·kubernetes
闲云野鹤在人间8 小时前
Kubernetes Pod Scheduler 详解
云原生·容器·kubernetes
正经教主9 小时前
【FDE系列】阶段2:Day 42(UP详细版):Dockerfile 实战 — 把你的应用打包成镜像
人工智能·docker·fde
刘马想放假9 小时前
Copyparty 轻量文件共享:Docker Compose 部署、权限与多协议使用全指南
docker·容器
切糕师学AI11 小时前
Kubernetes 探针全解析:启动探针、存活探针与就绪探针(Startup/Liveness/Readiness Probe)
容器·kubernetes·探针·probe
岁寒良木12 小时前
麒麟 V10 (x86_64) 离线/联网部署 Docker 26.1.4 与 MaxKB v2.10 LTS 实战指南
python·docker·kylin
fb_1234513 小时前
K8s调度实战全景-Pod调度与资源管控
云原生·容器·kubernetes
吴声子夜歌14 小时前
Kubernetes权威指南——Kubernetes安装配置指南(二进制文件安装)
容器·kubernetes