修改2
Some checks failed
Build and Release / build-and-test (alpine) (push) Failing after 1m48s
Build and Release / build-and-test (ubuntu) (push) Failing after 6m15s
Build and Release / docker-images (push) Has been skipped
Build and Release / release (push) Has been skipped

This commit is contained in:
2025-12-02 12:55:01 +08:00
parent dbad25ee73
commit 6a7e4ae6c6
2 changed files with 21 additions and 4 deletions

View File

@@ -23,6 +23,8 @@ FROM base AS build
ARG TARGZ_FILE ARG TARGZ_FILE
ARG XMRIGCC_VERSION ARG XMRIGCC_VERSION
ARG TARGETARCH ARG TARGETARCH
ARG BUILDPLATFORM
ARG TARGETPLATFORM
RUN git clone --recursive https://github.com/Bendr0id/xmrigCC.git && \ RUN git clone --recursive https://github.com/Bendr0id/xmrigCC.git && \
mv xmrigCC xxxigcc && \ mv xmrigCC xxxigcc && \
@@ -35,7 +37,14 @@ COPY ./init.sh ./init.sh
# 根据目标架构优化编译 # 根据目标架构优化编译
RUN chmod +x ./init.sh && ./init.sh && \ RUN chmod +x ./init.sh && ./init.sh && \
mkdir build && cd scripts && chmod +x ./*.sh && ./build_deps.sh && cd ../build && \ mkdir build && cd scripts && chmod +x ./*.sh && \
if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \
MAKE_JOBS="-j8"; \
else \
MAKE_JOBS="-j32"; \
fi && \
echo "Building with parallel jobs: $MAKE_JOBS (cross-compile: $([ "$BUILDPLATFORM" != "$TARGETPLATFORM" ] && echo yes || echo no))" && \
./build_deps.sh $MAKE_JOBS && cd ../build && \
if [ "$TARGETARCH" = "arm64" ]; then \ if [ "$TARGETARCH" = "arm64" ]; then \
cmake .. -DCMAKE_BUILD_TYPE=Release \ cmake .. -DCMAKE_BUILD_TYPE=Release \
-DXMRIG_DEPS=scripts/deps \ -DXMRIG_DEPS=scripts/deps \
@@ -60,7 +69,7 @@ RUN chmod +x ./init.sh && ./init.sh && \
-DWITH_OPENCL=OFF \ -DWITH_OPENCL=OFF \
-DWITH_CUDA=OFF; \ -DWITH_CUDA=OFF; \
fi && \ fi && \
make -j$(nproc) make $MAKE_JOBS
FROM scratch FROM scratch

View File

@@ -28,6 +28,7 @@ ARG TARGET_ARCH
ARG XMRIGCC_VERSION ARG XMRIGCC_VERSION
ARG TARGETARCH ARG TARGETARCH
ARG BUILDPLATFORM ARG BUILDPLATFORM
ARG TARGETPLATFORM
RUN git clone --recursive https://github.com/Bendr0id/xmrigCC.git && \ RUN git clone --recursive https://github.com/Bendr0id/xmrigCC.git && \
mv xmrigCC xxxigcc && \ mv xmrigCC xxxigcc && \
@@ -40,7 +41,14 @@ COPY ./init.sh ./init.sh
# 根据目标架构设置编译环境和参数 # 根据目标架构设置编译环境和参数
RUN chmod +x ./init.sh && ./init.sh && \ RUN chmod +x ./init.sh && ./init.sh && \
mkdir build && cd scripts && chmod +x ./*.sh && ./build_deps.sh && cd ../build && \ mkdir build && cd scripts && chmod +x ./*.sh && \
if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \
MAKE_JOBS="-j8"; \
else \
MAKE_JOBS="-j32"; \
fi && \
echo "Building with parallel jobs: $MAKE_JOBS (cross-compile: $([ "$BUILDPLATFORM" != "$TARGETPLATFORM" ] && echo yes || echo no))" && \
./build_deps.sh $MAKE_JOBS && cd ../build && \
if [ "$TARGETARCH" = "arm64" ] && [ "$BUILDPLATFORM" != "linux/arm64" ]; then \ if [ "$TARGETARCH" = "arm64" ] && [ "$BUILDPLATFORM" != "linux/arm64" ]; then \
export CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++; \ export CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++; \
cmake .. -DCMAKE_BUILD_TYPE=Release \ cmake .. -DCMAKE_BUILD_TYPE=Release \
@@ -62,7 +70,7 @@ RUN chmod +x ./init.sh && ./init.sh && \
-DXMRIG_DEPS=scripts/deps \ -DXMRIG_DEPS=scripts/deps \
-DWITH_ZLIB=ON; \ -DWITH_ZLIB=ON; \
fi && \ fi && \
make -j$(nproc) make $MAKE_JOBS
FROM scratch FROM scratch