diff --git a/README.md b/README.md index 1bc5a6c..86ef9e5 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ - 只允许应用仓库 CI 同步当前应用自己的 release 结果与 `Application.targetRevision` - `deploy/release/secret.yaml` 是唯一作者源;CI 只导出 `releases//manifests/secret.yaml` - 如果保留 `releases//manifests/` source,就必须保留固定模板的 `kustomization.yaml` +- 如果 Go 构建发生在 Dockerfile 内,`build-images` 必须用 `--build-arg` 透传 `GOPROXY` 等构建变量 - 需要公网 HTTP 入口时固定使用 nginx + 单一 `NodePort`,不改成 Ingress - 百智云用户鉴权是必填项,按固定顺序逐项补齐 `app_id` 与证书材料 - 平台 shared 之外的私有依赖必须明确来源;第三方镜像保持真实来源 diff --git a/gitops-app-onboarding/SKILL.md b/gitops-app-onboarding/SKILL.md index addb9ab..4a93d31 100644 --- a/gitops-app-onboarding/SKILL.md +++ b/gitops-app-onboarding/SKILL.md @@ -167,12 +167,17 @@ Go 项目默认变量写在 `.gitlab-ci.yml` 的 `variables:`: - 优先使用 `docker buildx` - 私有 Git 依赖通过 `.netrc` 和 build secret 传入 - 如需额外 CA,也通过 build secret 传入 +- 如果 Dockerfile 内会执行 `go mod download`、`go build` 等 Go 构建命令,必须通过 `--build-arg` 透传 Go 构建变量,不要只写在 `.gitlab-ci.yml` 的 `variables:` 里 +- 至少透传:`GOPROXY`、`GOSUMDB`、`GOINSECURE` +- 如果 Dockerfile 用到了 `GOPRIVATE`、`GONOSUMDB`、`GONOPROXY`,也一并透传 +- Dockerfile 中对应变量必须有 `ARG`,并让构建命令实际使用传入值,而不是退回默认值 禁止: - `http://registry...` - `--plain-http` - `--insecure-skip-tls-verify` +- 不要假设 `.gitlab-ci.yml` 中的环境变量会自动进入 `docker build` / `docker buildx build` ### package-chart job