初始化 proxy 打包项目,对齐 xxxig 矿工项目
Build and Release / build-and-test (amd64, alpine) (push) Successful in 20s
Build and Release / build-and-test (arm64, alpine) (push) Successful in 42s
Build and Release / build-and-test (amd64, ubuntu) (push) Successful in 27s
Build and Release / build-and-test (arm64, ubuntu) (push) Successful in 9s
Build and Release / release (push) Has been skipped
Build and Release / build-and-test (amd64, alpine) (push) Successful in 20s
Build and Release / build-and-test (arm64, alpine) (push) Successful in 42s
Build and Release / build-and-test (amd64, ubuntu) (push) Successful in 27s
Build and Release / build-and-test (arm64, ubuntu) (push) Successful in 9s
Build and Release / release (push) Has been skipped
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
# 使用 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 \
|
||||
libuv1-dev \
|
||||
libssl-dev \
|
||||
libhwloc-dev \
|
||||
openssl \
|
||||
&& 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
|
||||
|
||||
# 根据目标架构优化编译
|
||||
RUN mkdir build && cd build && \
|
||||
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))" && \
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release && \
|
||||
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
|
||||
Reference in New Issue
Block a user