Files
xxxigcc-proxy/llmdoc/architecture/docker-build-system.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

45 lines
1.3 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.
# Docker 构建系统架构
## 1. 系统身份
- **定义**:高度自动化且灵活的多架构 Docker 构建系统
- **目的**:支持跨平台(`amd64``arm64`和多发行版Ubuntu、Alpine的容器化构建
## 2. 核心组件
`- docker/Dockerfile.ubuntu` (`base`, `build`): Ubuntu 22.04 多阶段构建镜像
`- docker/Dockerfile.alpine` (`base`, `build`): Alpine Linux 多阶段构建镜像
`- .gitea/workflows/ci.yaml` (`BuildX`, `matrix`): Docker 多架构构建工作流
## 3. 执行流程LLM 检索映射)
### 多阶段构建流程
1. **基础阶段(`base`**
- 安装基础编译依赖
- 准备编译环境
2. **构建阶段(`build`**
- 克隆源代码
- 执行 `init.sh` 进行项目初始化
- 使用 CMake 编译项目
3. **最终镜像阶段**
- 仅保留编译产物
- 创建最小化镜像
### 多架构支持关键机制
- 使用 `TARGETARCH``BUILDPLATFORM` 动态调整构建
- 交叉编译时降低并行度(`-j2`
- 本地编译使用全部 CPU 核心(`-j$(nproc)`
## 4. 设计原理
### 构建优化策略
- 使用 Docker BuildKit 加速构建
- 禁用不必要的构建证明
- 动态调整构建作业并行度
### 跨平台兼容性
- 通过 `init.sh` 实现统一的项目初始化
- 支持 `amd64``arm64` 架构
- 兼容 Ubuntu 和 Alpine 发行版