From 66ec4df5570a4099f6b9541308d5218ac8bd5a1c Mon Sep 17 00:00:00 2001 From: Wang Defa Date: Mon, 15 Dec 2025 14:52:53 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=20README.md=20?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除 Alpine Linux 支持说明 - 强调纯静态链接特性 - 详细说明 Docker 多架构构建流程 - 添加静态链接验证方法 - 更新构建环境要求 - 更新本地构建说明 --- README.md | 77 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 59 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 6baedbe..8e73c4b 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ - 🏗️ **多架构支持** - 原生支持 AMD64 和 ARM64 架构 - 📦 **多种安装方式** - 提供 Debian 包和通用二进制包 -- 🐧 **多发行版兼容** - 支持 Ubuntu、Debian 和 Alpine Linux +- 🐧 **多发行版兼容** - 支持 Ubuntu 和 Debian +- 🔗 **纯静态链接** - 无需依赖,可在任意 Linux 系统运行 - 🔒 **隐私优先** - 基于 Monero 的隐私保护技术 - 🔄 **自动更新** - 通过 Debian 仓库轻松安装和更新 @@ -146,35 +147,75 @@ sudo systemctl disable mond.service ## 🏗️ 构建说明 -### 本地构建 +### Docker 构建(推荐) + +本项目使用 Docker 和官方 depends 系统构建,确保纯静态链接。 + +#### 构建多架构二进制文件 ```bash -# 1. 克隆源代码 -git clone .source +# 构建 amd64 和 arm64 架构 +docker buildx build --platform linux/amd64,linux/arm64 \ + -f docker/Dockerfile.ubuntu \ + --output type=local,dest=./output . +``` -# 2. 运行修改脚本 +#### 构建单一架构 + +```bash +# 仅构建 amd64 +docker buildx build --platform linux/amd64 \ + -f docker/Dockerfile.ubuntu \ + --output type=local,dest=./output . + +# 仅构建 arm64 +docker buildx build --platform linux/arm64 \ + -f docker/Dockerfile.ubuntu \ + --output type=local,dest=./output . +``` + +#### 验证静态链接 + +```bash +# 检查二进制文件是否为纯静态链接 +ldd output/linux_amd64/mond +# 预期输出: "not a dynamic executable" + +file output/linux_amd64/mond +# 预期输出: "statically linked" +``` + +### 本地构建 + +如果不使用 Docker,可以手动构建: + +```bash +# 1. 克隆并准备源代码 +git clone https://github.com/monero-project/monero.git .source cd .source +git checkout v0.18.3.4 +git submodule update --init --force + +# 2. 应用修改 ../init.sh -# 3. 构建 +# 3. 使用 depends 系统构建(推荐) +make -j$(nproc) depends target=x86_64-linux-gnu +# 二进制文件位于: build/x86_64-linux-gnu/release/bin/mond + +# 或者简单构建(需要手动安装依赖) mkdir -p build/release && cd build/release cmake ../.. -DCMAKE_BUILD_TYPE=Release -DBUILD_GUI_DEPS=OFF make -j$(nproc) daemon ``` -### Docker 构建 +### 构建环境要求 -```bash -# Ubuntu 构建 -docker buildx build --platform linux/amd64 \ - -f docker/Dockerfile.ubuntu \ - --output type=local,dest=./output . - -# Alpine 构建 -docker buildx build --platform linux/amd64 \ - -f docker/Dockerfile.alpine \ - --output type=local,dest=./output . -``` +- **操作系统**: Ubuntu 20.04(推荐)或更新版本 +- **CPU**: 多核 CPU(构建时间约 30-60 分钟) +- **内存**: 至少 4GB RAM +- **磁盘**: 至少 10GB 可用空间 +- **Docker**: 如使用 Docker 构建,需安装 Docker 和 buildx ## 📝 许可证