Docker 改静态链接 OpenSSL,修复跨发行版运行
Build and Release / build-and-test (arm64, alpine) (push) Successful in 6s
Build and Release / build-and-test (amd64, alpine) (push) Successful in 12s
Build and Release / build-and-test (amd64, ubuntu) (push) Successful in 22s
Build and Release / build-and-test (arm64, ubuntu) (push) Successful in 22s
Build and Release / release (push) Successful in 19s
Build and Release / build-and-test (arm64, alpine) (push) Successful in 6s
Build and Release / build-and-test (amd64, alpine) (push) Successful in 12s
Build and Release / build-and-test (amd64, ubuntu) (push) Successful in 22s
Build and Release / build-and-test (arm64, ubuntu) (push) Successful in 22s
Build and Release / release (push) Successful in 19s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
116023cd24
commit
a362c1a859
@@ -11,10 +11,10 @@ RUN apt-get update && apt-get install -y \
|
||||
wget \
|
||||
build-essential \
|
||||
cmake \
|
||||
libuv1-dev \
|
||||
libssl-dev \
|
||||
libhwloc-dev \
|
||||
openssl \
|
||||
automake \
|
||||
autoconf \
|
||||
libtool \
|
||||
perl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
FROM base AS build
|
||||
@@ -30,15 +30,16 @@ RUN git clone --recursive https://github.com/wangdefaa/xxxig-proxy.git && \
|
||||
|
||||
WORKDIR /xxxig-proxy
|
||||
|
||||
# 根据目标架构优化编译
|
||||
RUN mkdir build && cd build && \
|
||||
# 先编译静态依赖(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))" && \
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release && \
|
||||
./build_deps.sh $MAKE_JOBS && cd ../build && \
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DXMRIG_DEPS=scripts/deps -DBUILD_STATIC=ON && \
|
||||
make $MAKE_JOBS
|
||||
|
||||
FROM scratch
|
||||
|
||||
Reference in New Issue
Block a user