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]Description=Docker Application Container EngineDocumentation=https://docs.docker.comAfter=network-online.target firewalld.serviceWants=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 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.LimitNOFILE=infinityLimitNPROC=infinityLimitCORE=infinity# Uncomment TasksMax if your systemd version supports it.# Only systemd 226 and above support this version.#TasksMax=infinityTimeoutStartSec=0# set delegate yes so that systemd does not reset the cgroups of docker containersDelegate=yes# kill only the docker process, not all processes in the cgroupKillMode=process# restart the docker process if it exits prematurelyRestart=on-failureStartLimitBurst=3StartLimitInterval=60s[Install]WantedBy=multi-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 文件权限sudochmod+x /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-composesudochmod+x /usr/bin/docker-composedocker-composeversion