改用 musl 全静态修复 DNS 解析,并规范 Dockerfile 与产物命名
Build and Release / release (push) Successful in 7s
Build and Release / build-and-test (amd64) (push) Successful in 12s
Build and Release / build-and-test (arm64) (push) Successful in 1m38s

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-10 09:40:10 +08:00
co-authored by Claude Opus 4.8
parent a362c1a859
commit 3114521a35
6 changed files with 19 additions and 70 deletions
-50
View File
@@ -1,50 +0,0 @@
# 使用 Ubuntu 20.04 作为基础镜像(glibc 2.31,兼容更老系统)
FROM ubuntu:20.04 AS base
ARG TARGETARCH
ARG BUILDPLATFORM
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
git \
wget \
build-essential \
cmake \
automake \
autoconf \
libtool \
perl \
&& rm -rf /var/lib/apt/lists/*
FROM base AS build
ARG XXXIG_PROXY_VERSION
ARG TARGETARCH
ARG BUILDPLATFORM
ARG TARGETPLATFORM
RUN git clone --recursive https://github.com/wangdefaa/xxxig-proxy.git && \
cd xxxig-proxy && \
git checkout ${XXXIG_PROXY_VERSION}
WORKDIR /xxxig-proxy
# 先编译静态依赖(libuv/OpenSSL)到 scripts/deps,再静态链接构建 proxy
RUN mkdir build && cd scripts && chmod +x ./*.sh && \
if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \
MAKE_JOBS="-j2"; \
else \
MAKE_JOBS="-j$(nproc)"; \
fi && \
echo "Building with parallel jobs: $MAKE_JOBS (cross-compile: $([ "$BUILDPLATFORM" != "$TARGETPLATFORM" ] && echo yes || echo no))" && \
./build_deps.sh $MAKE_JOBS && cd ../build && \
cmake .. -DCMAKE_BUILD_TYPE=Release -DXMRIG_DEPS=scripts/deps -DBUILD_STATIC=ON && \
make $MAKE_JOBS
FROM scratch
ARG TARGETARCH
COPY --from=build /xxxig-proxy/build/xxxig-proxy /linux_${TARGETARCH}/xxxig-proxy
COPY --from=build /xxxig-proxy/src/config.json /linux_${TARGETARCH}/config.json