Files
mond/docker/Dockerfile.ubuntu
Wang Defa 319cadb352
All checks were successful
Build and Release Mond / build-and-test (amd64) (push) Successful in 11m52s
Build and Release Mond / build-and-test (arm64) (push) Successful in 18m1s
Build and Release Mond / release (push) Has been skipped
feat: 更新 Monero 版本至 v0.18.4.5,并调整相关文档和配置
2026-01-21 11:56:40 +08:00

84 lines
1.9 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
FROM ubuntu:20.04 AS base
ARG TARGETARCH
ARG BUILDPLATFORM
ENV DEBIAN_FRONTEND=noninteractive
# 安装构建依赖(包括 depends 系统所需工具)
RUN apt-get update && apt-get install -y \
git \
wget \
curl \
build-essential \
cmake \
pkg-config \
autoconf \
automake \
libtool \
bzip2 \
xz-utils \
python3 \
gperf \
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.4.5
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
# 使用官方 depends 系统构建静态依赖(参考 .source/Dockerfile
RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \
MAKE_JOBS=2; \
else \
MAKE_JOBS=$(nproc); \
fi && \
if [ "$TARGETARCH" = "arm64" ]; then \
DEPENDS_TARGET="aarch64-linux-gnu"; \
else \
DEPENDS_TARGET="x86_64-linux-gnu"; \
fi && \
echo "Building dependencies for $DEPENDS_TARGET with $MAKE_JOBS parallel jobs" && \
make -j$MAKE_JOBS depends target=$DEPENDS_TARGET && \
mkdir -p /output && \
cp build/$DEPENDS_TARGET/release/bin/mond /output/mond
# 最终阶段 - 只复制静态链接的二进制文件
FROM scratch
ARG TARGETARCH
COPY --from=build /output/mond /linux_${TARGETARCH}/mond