离线安装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
相关推荐
木雷坞几秒前
自托管 n8n:Docker Compose、Webhook 和升级备份排查
运维·容器
SilentSamsara3 分钟前
高并发 API 压测与调优:locust + 火焰图 + 瓶颈定位
开发语言·python·青少年编程·docker·中间件
kong@react10 分钟前
milvus(向量数据库)docker容器(升级1.0)
数据库·docker·milvus
开发者联盟league12 分钟前
docker登录失败解决方法。http: server gave HTTP response to HTTPS client
http·docker·https
quqi9914 分钟前
为什么电脑不亮灯(by quqi99)
docker·samba
qq_4523962314 分钟前
第十八篇:《Docker 监控与性能优化》
docker·容器·性能优化
openFuyao41 分钟前
AI Native基础设施的目标形态和它存在的一些挑战有哪些?K8s驱动异构算力面临挑战,下一代的K8s是渐进式优化,还是革命式的驱动AI的发展
人工智能·容器·kubernetes
Albert Edison1 小时前
【Docker】镜像仓库(Registry)
运维·docker·容器
IT策士1 小时前
第 41 篇 k8s之监控:Metrics Server 与 Prometheus 快速上手
容器·kubernetes·prometheus
梦梦代码精1 小时前
从源码到上线:实测开源电商系统的技术选型与部署落地
docker·开源