perf: 启用 Docker BuildKit 和 Maven 缓存优化构建速度
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled

- 启用 Docker BuildKit 缓存挂载
- 使用 --mount=type=cache 缓存 Maven 依赖
- 优化 Dockerfile 层缓存策略
- 添加构建优化指南文档

预期效果:
- 首次构建: ~30分钟
- 后续构建(无变更): ~2分钟
- 后续构建(有变更): ~5-8分钟
This commit is contained in:
lzh
2026-01-13 15:36:29 +08:00
parent deabc90f9a
commit 25fad8d6fd
3 changed files with 308 additions and 21 deletions

4
Jenkinsfile vendored
View File

@@ -22,6 +22,10 @@ pipeline {
// Docker Registry 配置
REGISTRY = 'localhost:5000'
// 启用 Docker BuildKit加速构建
DOCKER_BUILDKIT = '1'
BUILDKIT_PROGRESS = 'plain'
// Maven 配置
MAVEN_OPTS = '-Xmx2048m -Dmaven.repo.local=.m2/repository'