All checks were successful
Build and Release / build-and-test (arm64, alpine) (push) Successful in 16s
Build and Release / build-and-test (amd64, alpine) (push) Successful in 29s
Build and Release / build-and-test (arm64, ubuntu) (push) Successful in 27s
Build and Release / build-and-test (amd64, ubuntu) (push) Successful in 56s
Build and Release / release (push) Successful in 1m25s
47 lines
1.1 KiB
Docker
47 lines
1.1 KiB
Docker
FROM ubuntu:24.04 AS base
|
|
|
|
ARG TARGETARCH
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
git \
|
|
cmake \
|
|
gcc \
|
|
g++ \
|
|
make \
|
|
libuv1-dev \
|
|
libzmq3-dev \
|
|
libcurl4-openssl-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
FROM base AS build
|
|
|
|
ARG P2POOL_VERSION
|
|
ARG TARGETARCH
|
|
ARG BUILDPLATFORM
|
|
ARG TARGETPLATFORM
|
|
|
|
RUN git clone --recursive https://github.com/SChernykh/p2pool /src/p2pool
|
|
|
|
WORKDIR /src/p2pool
|
|
|
|
RUN git checkout ${P2POOL_VERSION}
|
|
|
|
# Determine parallel jobs based on cross-compilation and architecture
|
|
RUN mkdir build && cd build && \
|
|
if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \
|
|
MAKE_JOBS="-j2"; \
|
|
elif [ "$TARGETARCH" = "amd64" ]; then \
|
|
MAKE_JOBS="-j$(($(nproc) / 2))"; \
|
|
else \
|
|
MAKE_JOBS="-j$(nproc)"; \
|
|
fi && \
|
|
echo "Building with parallel jobs: $MAKE_JOBS (arch: $TARGETARCH, cross-compile: $([ "$BUILDPLATFORM" != "$TARGETPLATFORM" ] && echo yes || echo no))" && \
|
|
cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_MERGE_MINING_DONATION=OFF && \
|
|
make $MAKE_JOBS
|
|
|
|
FROM scratch
|
|
|
|
ARG TARGETARCH
|
|
|
|
COPY --from=build /src/p2pool/build/p2pool /linux_${TARGETARCH}/p2pool
|