7 Commits

Author SHA1 Message Date
a418a680f6 更新 Dockerfile 2025-06-24 10:27:20 +08:00
4862d39139 fix: Optimize Docker build and resolve network timeout issues
根据Gemini建议的优化方案:

 **Dockerfile修复**:
- 修复FROM语句大小写警告 (as -> AS)
- 修复Maven settings.xml中的XML标签错误 (<n> -> <name>)
- 优化健康检查端点支持Actuator标准
- 统一使用mvnw执行命令

 **Jenkinsfile优化**:
- 简化Docker buildx命令,移除可能导致网络问题的参数
- 添加备用构建方案:Buildx失败时自动切换到传统Docker构建
- 移除复杂的缓存配置,先确保基本构建正常
- 优化错误处理和重试逻辑
- 减少重试次数避免无谓等待

 **工具脚本**:
- setup-docker-mirrors.sh: 配置Docker镜像加速器
- test-docker-build.sh: 测试Docker构建环境
- 包含网络优化和构建器验证

**主要解决问题**:
- Docker Hub网络超时问题
- Buildx配置复杂性
- 构建失败时的降级策略

下一步建议在服务器运行 scripts/setup-docker-mirrors.sh 配置镜像加速器
2025-06-24 10:08:54 +08:00
98b08af4a3 fix: Remove network.host and simplify Buildx configuration
Issues fixed:
-  Remove --network=host (not allowed by daemon config)
-  Remove --mount=type=cache from Dockerfile (compatibility)
-  Simplify builder management and error handling
-  Keep caches on build failure for faster retries
-  Use standard Docker layer caching instead of BuildKit mount

This should resolve the 'granting entitlement network.host is not allowed' error.
2025-06-24 09:08:13 +08:00
1f90427fb7 feat: Enable Docker Buildx for faster and more reliable builds
Features:
-  Enable Docker Buildx with advanced caching
-  Add BuildKit cache mount for Maven dependencies
-  Use Aliyun Maven mirror for faster dependency downloads
-  Optimize Docker layer caching strategy
-  Add automatic cache cleanup to prevent disk overflow
-  Increase build timeout to 30 minutes
-  Add buildx builder instance management

Performance improvements:
- Parallel builds with Buildx
- Persistent Maven cache with RUN --mount=type=cache
- Layer-optimized Dockerfile structure
- Automatic cache rotation

This should significantly reduce Docker build time and improve reliability.
2025-06-24 00:08:36 +08:00
b285211b6c fix: add execute permission to mvnw script in Docker build 2025-06-23 23:17:37 +08:00
caa85bc6e8 perf: optimize Docker build - use Alpine images, add timeout handling and retry logic 2025-06-23 22:36:43 +08:00
877335f73f Initial commit: Jenkins CI/CD Demo Project with Spring Boot 3 2025-06-23 16:50:28 +08:00