首次提交
Some checks failed
Build and Release / build-and-test (arm64, alpine) (push) Successful in 8s
Build and Release / build-and-test (amd64, alpine) (push) Successful in 14s
Build and Release / build-and-test (arm64, ubuntu) (push) Successful in 14s
Build and Release / build-and-test (amd64, ubuntu) (push) Successful in 23s
Build and Release / release (push) Failing after 26s
Some checks failed
Build and Release / build-and-test (arm64, alpine) (push) Successful in 8s
Build and Release / build-and-test (amd64, alpine) (push) Successful in 14s
Build and Release / build-and-test (arm64, ubuntu) (push) Successful in 14s
Build and Release / build-and-test (amd64, ubuntu) (push) Successful in 23s
Build and Release / release (push) Failing after 26s
This commit is contained in:
54
docker/Dockerfile.alpine
Normal file
54
docker/Dockerfile.alpine
Normal file
@@ -0,0 +1,54 @@
|
||||
FROM alpine:latest AS base
|
||||
|
||||
# 根据目标架构设置构建参数
|
||||
ARG TARGETARCH
|
||||
|
||||
RUN apk update && apk add --no-cache \
|
||||
git \
|
||||
make \
|
||||
cmake \
|
||||
libstdc++ \
|
||||
gcc \
|
||||
g++ \
|
||||
automake \
|
||||
libtool \
|
||||
autoconf \
|
||||
linux-headers \
|
||||
libuv-dev \
|
||||
openssl-dev \
|
||||
hwloc-dev
|
||||
|
||||
FROM base AS build
|
||||
|
||||
ARG XMRIGCC_PROXY_VERSION
|
||||
ARG TARGETARCH
|
||||
ARG BUILDPLATFORM
|
||||
ARG TARGETPLATFORM
|
||||
|
||||
RUN git clone --recursive https://github.com/Bendr0id/xmrigcc-proxy.git && \
|
||||
mv xmrigcc-proxy xxxigcc-proxy && \
|
||||
cd xxxigcc-proxy && \
|
||||
git checkout ${XMRIGCC_PROXY_VERSION}
|
||||
|
||||
WORKDIR /xxxigcc-proxy
|
||||
|
||||
COPY ./init.sh ./init.sh
|
||||
|
||||
# 根据目标架构优化编译
|
||||
RUN chmod +x ./init.sh && ./init.sh && \
|
||||
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 /xxxigcc-proxy/build/xxxigcc-proxy /linux_${TARGETARCH}/xxxigcc-proxy
|
||||
COPY --from=build /xxxigcc-proxy/src/config.json /linux_${TARGETARCH}/config.json
|
||||
53
docker/Dockerfile.ubuntu
Normal file
53
docker/Dockerfile.ubuntu
Normal file
@@ -0,0 +1,53 @@
|
||||
# 使用 Ubuntu 22.04 作为基础镜像
|
||||
FROM ubuntu:22.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 XMRIGCC_PROXY_VERSION
|
||||
ARG TARGETARCH
|
||||
ARG BUILDPLATFORM
|
||||
ARG TARGETPLATFORM
|
||||
|
||||
RUN git clone --recursive https://github.com/Bendr0id/xmrigcc-proxy.git && \
|
||||
mv xmrigcc-proxy xxxigcc-proxy && \
|
||||
cd xxxigcc-proxy && \
|
||||
git checkout ${XMRIGCC_PROXY_VERSION}
|
||||
|
||||
WORKDIR /xxxigcc-proxy
|
||||
|
||||
COPY ./init.sh ./init.sh
|
||||
|
||||
# 根据目标架构优化编译
|
||||
RUN chmod +x ./init.sh && ./init.sh && \
|
||||
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 /xxxigcc-proxy/build/xxxigcc-proxy /linux_${TARGETARCH}/xxxigcc-proxy
|
||||
COPY --from=build /xxxigcc-proxy/src/config.json /linux_${TARGETARCH}/config.json
|
||||
Reference in New Issue
Block a user