
2000cubits/ci本Docker镜像专为持续集成(CI)流程设计,集成了多种常用开发、构建和测试工具,旨在简化CI环境配置,提供一致的构建和测试环境,减少因环境差异导致的构建或测试失败,提升开发团队协作效率。
bashdocker pull [镜像仓库地址]/ci-image:latest
bashdocker run -it --rm [镜像仓库地址]/ci-image:latest /bin/bash
bash# Java Maven项目示例 docker run --rm -v $(pwd):/app -w /app [镜像仓库地址]/ci-image:latest mvn clean package # Node.js项目示例 docker run --rm -v $(pwd):/app -w /app [镜像仓库地址]/ci-image:latest npm install && npm run build # Python项目示例 docker run --rm -v $(pwd):/app -w /app [镜像仓库地址]/ci-image:latest python -m pip install -r requirements.txt && pytest
yamlstages: - build - test build_job: stage: build image: [镜像仓库地址]/ci-image:latest script: - mvn clean compile test_job: stage: test image: [镜像仓库地址]/ci-image:latest script: - mvn test artifacts: paths: - target/surefire-reports/
| 环境变量 | 描述 | 默认值 |
|---|---|---|
MAVEN_MIRROR_URL | Maven仓库镜像地址 | 官方Maven中央仓库 |
NPM_REGISTRY | npm registry地址 | [***] |
HTTP_PROXY | HTTP代理设置 | 无 |
HTTPS_PROXY | HTTPS代理设置 | 无 |
LANG | 系统语言环境 | en_US.UTF-8 |
bashdocker run --rm -e HTTP_PROXY=[***] \ -e HTTPS_PROXY=[***] \ [镜像仓库地址]/ci-image:latest npm install
如需修改工具默认配置(如Maven settings.xml、npm .npmrc),可通过挂载配置文件实现:
bash# 挂载自定义Maven配置 docker run --rm -v $(pwd)/custom-settings.xml:/root/.m2/settings.xml \ -v $(pwd):/app -w /app [镜像仓库地址]/ci-image:latest mvn clean package

manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务