
ARM架构下安装新版docker及docker-compose安装docker下载aarch64下的docker源码安装包wgethttps://download.docker.com/linux/static/stable/aarch64/docker-29.6.2.tgz准备docker.service文件sudovimdocker.service将下面的内容全部写入docker.service文件中[Unit]DescriptionDocker Application Container EngineDocumentationhttps://docs.docker.comAfternetwork-online.target firewalld.serviceWantsnetwork-online.target[Service]Typenotify# 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 dockerExecStart/usr/bin/dockerdExecReload/bin/kill-sHUP$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.LimitNOFILEinfinityLimitNPROCinfinityLimitCOREinfinity# Uncomment TasksMax if your systemd version supports it.# Only systemd 226 and above support this version.#TasksMaxinfinityTimeoutStartSec0# set delegate yes so that systemd does not reset the cgroups of docker containersDelegateyes# kill only the docker process, not all processes in the cgroupKillModeprocess# restart the docker process if it exits prematurelyRestarton-failureStartLimitBurst3StartLimitInterval60s[Install]WantedBymulti-user.target安装# 解压 docker 到当前目录sudotar-xvfdocker-27.2.0.tgz# 将 docker 文件移动到 /usr/bin 目录下sudocp-pdocker/* /usr/bin# 将 docker.service 移到 /etc/systemd/system/ 目录sudocpdocker.service /etc/systemd/system/# 设置 docker.service 文件权限sudochmodx /etc/systemd/system/docker.service# 重新加载配置文件sudosystemctl daemon-reload# 启动dockersudosystemctl startdocker# 启动如果报错,先查看一下系统日志tail-200f/var/log/messages# 发现报错 docker.service: Failed to locate executable /usr/bin/dockerd: Permission denied# 可能系统启用了 SELinux 关闭 SELinuxsudosetenforce0# 启动dockersudosystemctl startdocker# 检查 Docker 是否能启动sudosystemctl statusdocker# 如果 Docker 能启动则可能是 SELinux 策略的问题# sudo setenforce 1 # 这里重启拉取镜像报错# 设置 docker 开机自启sudosystemctlenabledocker# 验证安装是否成功dockerversion安装docker-compose下载aarch64下的docker源码安装包wgethttps://github.com/docker/compose/releases/download/v5.3.1/docker-compose-linux-armv6配置文件sudomvdocker-compose-linux-aarch64 /usr/bin/docker-composesudochmodx /usr/bin/docker-composedocker-composeversion