离线安装docker和docker-compose

操作系统: UOS Desktop 20 Professional

安装包:docker-24.0.9.tgz,docker-compose-linux-x86_64

离线安装docker

1.将安装包docker-24.0.9.tgz上传至packages,并进行解压 tar -zxvf docker-24.0.9.tgz;

2.将解压后的文件拷贝至/usr/bin: cp ./docker/* /usr/bin;

3.配置守护进程,编写vi /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 -H unix:///var/run/docker.sock --selinux-enabled=false --default-ulimit nofile=65536:65536
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

4.添加可执行权限,重载守护进程,启动服务。

chmod +x /etc/systemd/system/docker.service

systemctl daemon-reload

systemctl start docker

通过docker version命令查看docker版本。

离线安装docker-compose

1.将docker-compose-linux-x86_64拷贝至/usr/bin目录;

2.修改名称, mv docker-compose-linux-x86_64 docker-compose;

3.添加可执行权限:chmod +x docker-compose;

执行docker-compose version即可查看版本。

问题及建议

使用docker部署mysql5.6时正常,但部署8.0.39版本时容器启动失败,原因未知。

建议使用系统厂家充分测试过的docker版本,虽然版本低,但是稳定点。

使用离线部署的新的docker版本的话,就要充分测试一些。

相关推荐
算力魔方AIPC13 小时前
使用 Docker 一键部署 PaddleOCR-VL: 新手保姆级教程
运维·docker·容器
Ghost Face...14 小时前
Docker实战:从安装到多容器编排指南
运维·docker·容器
TSAI15 小时前
Docker Swarm 集群部署 Eureka 服务注册中心:高可用微服务架构的基石
spring cloud·docker
不惑_15 小时前
Windows 安装 Docker 和 Docker Compose 完整教程
windows·docker·容器
云霄IT16 小时前
docker使用教程之部署第一个go项目
docker·容器·golang
探索云原生16 小时前
Buildah 简明教程:让镜像构建更轻量,告别 Docker 依赖
linux·docker·云原生·go·cicd
UtopianCoding17 小时前
什么是NoteDiscovery?Obsidian 的开源平替?
python·docker·开源
学习3人组17 小时前
CentOS9安装Docker
docker·容器·eureka
何包蛋H19 小时前
Docker Maven 插件深度配置指南:Spotify vs Fabric8
docker·容器·maven
从零开始学习人工智能19 小时前
解决Docker容器无法访问宿主机IP和端口的全维度实践指南
tcp/ip·docker·容器