首次提交
Some checks failed
Build and Release Mond / build-and-test (arm64, alpine) (push) Failing after 1m3s
Build and Release Mond / build-and-test (amd64, alpine) (push) Failing after 1m39s
Build and Release Mond / build-and-test (arm64, ubuntu) (push) Failing after 2m24s
Build and Release Mond / build-and-test (amd64, ubuntu) (push) Failing after 3m2s
Build and Release Mond / release (push) Has been skipped
Some checks failed
Build and Release Mond / build-and-test (arm64, alpine) (push) Failing after 1m3s
Build and Release Mond / build-and-test (amd64, alpine) (push) Failing after 1m39s
Build and Release Mond / build-and-test (arm64, ubuntu) (push) Failing after 2m24s
Build and Release Mond / build-and-test (amd64, ubuntu) (push) Failing after 3m2s
Build and Release Mond / release (push) Has been skipped
This commit is contained in:
64
docker/Dockerfile.alpine
Normal file
64
docker/Dockerfile.alpine
Normal file
@@ -0,0 +1,64 @@
|
||||
FROM alpine:3.18 AS base
|
||||
|
||||
ARG TARGETARCH
|
||||
ARG BUILDPLATFORM
|
||||
|
||||
# 安装构建依赖
|
||||
RUN apk add --no-cache \
|
||||
git \
|
||||
wget \
|
||||
build-base \
|
||||
cmake \
|
||||
boost-dev \
|
||||
openssl-dev \
|
||||
zeromq-dev \
|
||||
unbound-dev \
|
||||
libsodium-dev \
|
||||
libunwind-dev \
|
||||
xz-dev \
|
||||
readline-dev \
|
||||
expat-dev \
|
||||
hidapi-dev \
|
||||
libusb-dev \
|
||||
protobuf-dev \
|
||||
eudev-dev \
|
||||
linux-headers \
|
||||
pkgconfig
|
||||
|
||||
FROM base AS build
|
||||
|
||||
ARG MONERO_VERSION=v0.18.3.4
|
||||
ARG TARGETARCH
|
||||
ARG BUILDPLATFORM
|
||||
ARG TARGETPLATFORM
|
||||
|
||||
# 克隆 Monero 项目
|
||||
RUN git clone --recursive https://github.com/monero-project/monero.git && \
|
||||
cd monero && \
|
||||
git checkout ${MONERO_VERSION} && \
|
||||
git submodule update --init --force
|
||||
|
||||
WORKDIR /monero
|
||||
|
||||
# 复制并运行 init.sh 脚本进行修改
|
||||
COPY ./init.sh ./init.sh
|
||||
|
||||
RUN chmod +x ./init.sh && sed -i 's|/bin/sh|/bin/ash|' ./init.sh && ./init.sh
|
||||
|
||||
# 构建 Monero (mond)
|
||||
RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \
|
||||
MAKE_JOBS="-j2"; \
|
||||
else \
|
||||
MAKE_JOBS="-j$(nproc)"; \
|
||||
fi && \
|
||||
echo "Building with parallel jobs: $MAKE_JOBS" && \
|
||||
mkdir -p build/release && cd build/release && \
|
||||
cmake ../.. -DCMAKE_BUILD_TYPE=Release -DBUILD_GUI_DEPS=OFF -DARCH=default -DSTATIC=ON && \
|
||||
make $MAKE_JOBS daemon
|
||||
|
||||
# 最终阶段 - 只复制二进制文件
|
||||
FROM scratch
|
||||
|
||||
ARG TARGETARCH
|
||||
|
||||
COPY --from=build /monero/build/release/bin/mond /linux_${TARGETARCH}/mond
|
||||
70
docker/Dockerfile.ubuntu
Normal file
70
docker/Dockerfile.ubuntu
Normal file
@@ -0,0 +1,70 @@
|
||||
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 \
|
||||
pkg-config \
|
||||
libboost-all-dev \
|
||||
libssl-dev \
|
||||
libzmq3-dev \
|
||||
libunbound-dev \
|
||||
libsodium-dev \
|
||||
libunwind8-dev \
|
||||
liblzma-dev \
|
||||
libreadline-dev \
|
||||
libexpat1-dev \
|
||||
libpgm-dev \
|
||||
qttools5-dev-tools \
|
||||
libhidapi-dev \
|
||||
libusb-1.0-0-dev \
|
||||
libprotobuf-dev \
|
||||
protobuf-compiler \
|
||||
libudev-dev \
|
||||
libgtest-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
FROM base AS build
|
||||
|
||||
ARG MONERO_VERSION=v0.18.3.4
|
||||
ARG TARGETARCH
|
||||
ARG BUILDPLATFORM
|
||||
ARG TARGETPLATFORM
|
||||
|
||||
# 克隆 Monero 项目
|
||||
RUN git clone --recursive https://github.com/monero-project/monero.git && \
|
||||
cd monero && \
|
||||
git checkout ${MONERO_VERSION} && \
|
||||
git submodule update --init --force
|
||||
|
||||
WORKDIR /monero
|
||||
|
||||
# 复制并运行 init.sh 脚本进行修改
|
||||
COPY ./init.sh ./init.sh
|
||||
|
||||
RUN chmod +x ./init.sh && ./init.sh
|
||||
|
||||
# 构建 Monero (mond)
|
||||
RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \
|
||||
MAKE_JOBS="-j2"; \
|
||||
else \
|
||||
MAKE_JOBS="-j$(nproc)"; \
|
||||
fi && \
|
||||
echo "Building with parallel jobs: $MAKE_JOBS" && \
|
||||
mkdir -p build/release && cd build/release && \
|
||||
cmake ../.. -DCMAKE_BUILD_TYPE=Release -DBUILD_GUI_DEPS=OFF -DARCH=default && \
|
||||
make $MAKE_JOBS daemon
|
||||
|
||||
# 最终阶段 - 只复制二进制文件
|
||||
FROM scratch
|
||||
|
||||
ARG TARGETARCH
|
||||
|
||||
COPY --from=build /monero/build/release/bin/mond /linux_${TARGETARCH}/mond
|
||||
Reference in New Issue
Block a user