Files
mond/docker/Dockerfile.ubuntu
T
wangdefaandClaude Opus 4.8 317973e94d
Build and Release Mond / build-and-test (amd64) (push) Successful in 11m47s
Build and Release Mond / build-and-test (arm64) (push) Successful in 18m24s
Build and Release Mond / release (push) Has been skipped
feat: 对齐 xxxig/proxy 打包规范并迁移配置至 /etc/mond
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 22:00:48 +08:00

71 lines
1.8 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
# 仅安装 Monero depends 系统所需的最小工具链:
# depends 会自行交叉编译 boost/openssl/zmq/unbound/sodium 等全部第三方库到 contrib/depends/<target>/
# 故无需任何系统 -dev 库(装了反而可能被动态链接、破坏纯静态)。
RUN apt-get update && apt-get install -y \
git \
wget \
curl \
ca-certificates \
build-essential \
cmake \
pkg-config \
autoconf \
automake \
libtool \
gperf \
python3 \
bzip2 \
xz-utils \
patch \
&& rm -rf /var/lib/apt/lists/*
FROM base AS build
ARG MONERO_VERSION
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