离线安装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
相关推荐
小小龙学IT2 小时前
Kubernetes 深度实践:架构、API 与避坑指南
容器·架构·kubernetes
cpolar技术支持4 小时前
外网测试机的异常传不回内网?自托管 Sentry,用 cpolar 打通错误上报链路
python·nginx·docker·cpolar·sentry
MrSYJ6 小时前
别人再问你路由表是啥,这篇文章摔它脸上
docker·云原生·kubernetes
羑悻7 小时前
穿越Docker内核迷雾:揭秘镜像分层存储的叠加态与卷挂载的多维空间穿梭技术
后端·docker·容器
for_ever_love__8 小时前
容器类型全家桶——list、tuple、dict、set 与推导式
python·容器·数据类型·大模型开发
筑梦之路8 小时前
docker-compose方式部署kafka集群(Kraft方式)——筑梦之路
docker·容器·kafka
JavaPub-rodert9 小时前
Docker 镜像地址总失效?基于 DockerHub 项目用 GitHub Actions 做一个自动检测状态页
docker·容器·github
天衍四九-9 小时前
Docker 进阶实战系列(一):容器镜像安全,最小镜像与非 Root 运行
安全·docker·eureka
天衍四九-9 小时前
Docker进阶实战系列(二):容器日志深度治理|驱动配置、自动切割、磁盘爆满彻底解决
docker·容器·eureka
sbjdhjd10 小时前
云安全 | Docker 容器逃逸复盘(一):从隔离边界到运行时链路,如何确认自己身处容器
网络安全·docker·云原生·容器·kubernetes·云计算·云安全