Files
xxxigcc-proxy/llmdoc/architecture/multi-arch-strategy.md
Wang Defa 9afe4a8649
All checks were successful
Build and Release / build-and-test (arm64, alpine) (push) Successful in -13s
Build and Release / build-and-test (amd64, alpine) (push) Successful in -6s
Build and Release / build-and-test (arm64, ubuntu) (push) Successful in -7s
Build and Release / build-and-test (amd64, ubuntu) (push) Successful in 7s
Build and Release / release (push) Successful in 21s
简化 Debian 发布流程并添加项目文档系统
- 将 Debian 包仓库从 bookworm/trixie 双发行版改为通用 stable 仓库
- 新增完整的 llmdoc 文档系统,包含架构、指南和参考文档
- 更新 README.md 和部署指南以反映新的仓库配置
- 添加 .gitignore 文件
2025-12-25 10:18:07 +08:00

48 lines
1.1 KiB
Markdown
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.
# 多架构构建策略详解
## 1. 架构支持
### 目标架构
- `amd64`x86_64
- `arm64`ARM 64位
## 2. 交叉编译优化
### 编译参数调整
- 跨平台编译时:`MAKE_JOBS=-j2`
- 本地平台编译:`MAKE_JOBS=-j$(nproc)`
### 关键构建参数
- `TARGETARCH`:目标架构
- `BUILDPLATFORM`:构建主机架构
- `TARGETPLATFORM`:完整目标平台信息
## 3. 依赖管理
### 架构相关依赖处理
- Ubuntu通过 `apt-get` 安装依赖
- Alpine使用 `apk add` 安装跨平台工具链
### 关键依赖工具
- `gcc`/`g++`:编译器
- `cmake`:跨平台构建系统
- `libuv-dev`:异步 I/O 库
- `libssl-dev`SSL/TLS 库
- `hwloc-dev`:硬件定位库
## 4. 构建流程优化
### BuildKit 配置
- 启用 `DOCKER_BUILDKIT=1`
- 禁用默认构建证明 `BUILDX_NO_DEFAULT_ATTESTATIONS=1`
### 构建缓存策略
- 多阶段构建减少最终镜像大小
- 分层缓存提高重复构建效率
## 5. 最佳实践
### 跨平台兼容性
- 使用 `init.sh` 统一项目配置
- 确保代码和构建脚本平台无关
- 避免硬编码平台相关的路径或命令