From 8014002dff104ce332e8e4f14a2461f51adf19b9 Mon Sep 17 00:00:00 2001 From: Wang Defa Date: Mon, 15 Dec 2025 14:46:21 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=A7=BB=E9=99=A4=20Alpine=20?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Alpine (musl libc) 与 Monero depends 系统兼容性问题过多: - 系统包无法提供所需的静态库 - depends 系统在 musl 环境下存在各种依赖问题 - 维护成本高且不可靠 保留 Ubuntu 20.04 方案,已验证可实现纯静态链接 --- docker/Dockerfile.alpine | 64 ---------------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 docker/Dockerfile.alpine diff --git a/docker/Dockerfile.alpine b/docker/Dockerfile.alpine deleted file mode 100644 index 481d8d0..0000000 --- a/docker/Dockerfile.alpine +++ /dev/null @@ -1,64 +0,0 @@ -FROM alpine:3.18 AS base - -ARG TARGETARCH -ARG BUILDPLATFORM - -# 安装 depends 系统和 Monero 构建所需的依赖 -RUN apk add --no-cache \ - git \ - wget \ - curl \ - build-base \ - cmake \ - pkgconf \ - autoconf \ - automake \ - libtool \ - bzip2 \ - xz \ - python3 \ - gperf \ - linux-headers - -FROM base AS build - -ARG MONERO_VERSION=v0.18.3.4 -ARG TARGETARCH -ARG BUILDPLATFORM -ARG TARGETPLATFORM - -# 克隆 Monero 项目 -RUN git clone --recursive https://github.com/monero-project/monero.git && \ - cd monero && \ - git checkout ${MONERO_VERSION} && \ - git submodule update --init --force - -WORKDIR /monero - -# 复制并运行 init.sh 脚本进行修改 -COPY ./init.sh ./init.sh - -RUN chmod +x ./init.sh && sed -i 's|/bin/sh|/bin/ash|' ./init.sh && ./init.sh - -# 使用官方 depends 系统构建静态依赖(参考 Ubuntu Dockerfile) -RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \ - MAKE_JOBS=2; \ - else \ - MAKE_JOBS=$(nproc); \ - fi && \ - if [ "$TARGETARCH" = "arm64" ]; then \ - DEPENDS_TARGET="aarch64-linux-gnu"; \ - else \ - DEPENDS_TARGET="x86_64-linux-gnu"; \ - fi && \ - echo "Building dependencies for $DEPENDS_TARGET with $MAKE_JOBS parallel jobs" && \ - make -j$MAKE_JOBS depends target=$DEPENDS_TARGET && \ - mkdir -p /output && \ - cp build/$DEPENDS_TARGET/release/bin/mond /output/mond - -# 最终阶段 - 只复制静态链接的二进制文件 -FROM scratch - -ARG TARGETARCH - -COPY --from=build /output/mond /linux_${TARGETARCH}/mond