Skip to content

[BUG] ARM64 镜像无法启动:/bin/busybox 为空文件,导致 exec format error #16

@Marrrrrrrrry

Description

@Marrrrrrrrry

请确认以下事项

  • 我已确认阅读并同意 AGPL-3.0 第15条
    本程序不提供任何明示或暗示的担保,使用风险由您自行承担。

  • 我已确认阅读并同意 AGPL-3.0 第16条
    无论何种情况,版权持有人或其他分发者均不对使用本程序所造成的任何损失承担责任。

  • 我确认我的描述清晰,语法礼貌,能帮助开发者快速定位问题,并符合社区规则。

  • 我已确认阅读了OpenList文档

  • 我已确认没有重复的问题或讨论。

  • 我已确认是OpenList的问题,而不是其他原因(例如 网络依赖操作)。

  • 我认为此问题必须由OpenList处理,而非第三方。

  • 我已确认这个问题在最新版本中没有被修复。

  • 我没有阅读这个清单,只是闭眼选中了所有的复选框,请关闭这个 Issue 。

OpenList 版本(必填)

v4.2.2

使用的存储驱动(必填)

local

问题描述(必填)

问题描述

在 ARM64/aarch64 设备(树莓派 4,Armbian)上运行官方镜像 openlistteam/openlist:latest 时,容器启动后立即退出,报错:

exec /entrypoint.sh: exec format error

根因分析

经过逐步排查,确认问题链路如下:

  1. entrypoint.sh 的 shebang 为 #!/bin/sh
  2. Alpine 中 /bin/sh 是指向 /bin/busybox 的符号链接
  3. ARM64 镜像中 /bin/busybox0 字节空文件,导致 /bin/sh 无法执行
  4. /bin/bash 正常(919304 字节,有效 ARM64 ELF),/opt/openlist/openlist 二进制也正常

排查过程

步骤 操作 结果
1 检查最终镜像 busybox 0 字节,空文件
2 检查基础镜像 ghcr.io/openlistteam/openlist-base-image:base 的 busybox 0 字节,空文件
3 检查上游 alpine:edge 的 busybox 0 字节,空文件
4 检查稳定版 alpine:3.21 的 busybox 919304 字节,正常

验证命令及输出:

# alpine:edge — busybox 为空
$ docker create --name edge-test alpine:edge && \
  docker cp edge-test:/bin/busybox /tmp/busybox-edge && \
  wc -c /tmp/busybox-edge && docker rm edge-test
0 /tmp/busybox-edge

# alpine:3.21 — busybox 正常
$ docker create --name stable-test alpine:3.21 && \
  docker cp stable-test:/bin/busybox /tmp/busybox-stable && \
  wc -c /tmp/busybox-stable && docker rm stable-test
919304 /tmp/busybox-stable

# openlistteam/openlist:latest — busybox 为空(继承自 alpine:edge)
$ docker create --name openlist-test openlistteam/openlist:latest && \
  docker cp openlist-test:/bin/busybox /tmp/busybox-openlist && \
  wc -c /tmp/busybox-openlist && docker rm openlist-test
0 /tmp/busybox-openlist

根因结论

问题根因是 alpine:edge 的 ARM64 镜像中 /bin/busybox 为 0 字节空文件(上游 bug)。OpenList 基础镜像 FROM alpine:edge 继承了此问题。

完整链路:

alpine:edge (ARM64 busybox 为空)
  → openlist-base-image (FROM alpine:edge,busybox 继承为空)
    → openlistteam/openlist:latest (busybox 仍为空)
      → /bin/sh → /bin/busybox (空) → exec format error

环境信息

  • 设备:树莓派 4,Armbian,uname -m = aarch64
  • Docker:29.4.3,存储驱动 overlayfs,文件系统 ext4
  • 镜像架构:arm64(已通过 docker inspect 确认)

临时解决方案

使用 --entrypoint /bin/bash 绕过损坏的 /bin/sh

docker run -d \
  --name openlist \
  --restart unless-stopped \
  -v /etc/openlist:/opt/openlist/data \
  -p 5244:5244 \
  --entrypoint /bin/bash \
  openlistteam/openlist:latest \
  -c "cd /opt/openlist && ./openlist server --data /opt/openlist/data"

建议修复

  1. 将基础镜像 FROM alpine:edge 改为 FROM alpine:3.21(稳定版)
  2. 同时修改本仓库 Dockerfile 中的 FROM alpine:edge AS builder

日志(必填)

exec format error

配置文件内容(必填)

docker run -d
--name openlist
--restart unless-stopped
-v /etc/openlist:/opt/openlist/data
-p 5244:5244
--entrypoint /bin/bash
openlistteam/openlist:latest
-c "cd /opt/openlist && ./openlist server --data /opt/openlist/data"

复现链接(可选)

No response

AI生成内容(可选)

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions