fix(build): remove GHCR from API image supply chain
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m32s
CD Pipeline / build-and-deploy (push) Successful in 5m48s
AWOOOI Harbor 110 Local Repair / workflow-shape (push) Successful in 0s
AWOOOI Harbor 110 Local Repair / harbor-110-local-repair (push) Successful in 10s
CD Pipeline / post-deploy-checks (push) Successful in 1m53s

This commit is contained in:
ogt
2026-07-11 01:10:13 +08:00
parent e4518ad803
commit b0e23b97f3
2 changed files with 13 additions and 2 deletions

View File

@@ -15,8 +15,10 @@ FROM python:3.11-slim AS builder
WORKDIR /app
# Install uv (固定版本,禁止 :latest)
COPY --from=ghcr.io/astral-sh/uv:0.6.9 /uv /bin/uv
# Install a pinned uv wheel inside the existing builder. Do not introduce a
# GitHub Container Registry build stage into the Gitea/Harbor supply chain.
ARG UV_VERSION=0.6.9
RUN python -m pip install --no-cache-dir "uv==${UV_VERSION}"
# Phase 6.4i: 複製本地 packages 到 Docker context
COPY packages/lewooogo-data/ /packages/lewooogo-data/

View File

@@ -135,6 +135,15 @@ def test_gitea_workflows_never_download_github_actions() -> None:
assert forbidden_domain not in source, path
def test_api_image_build_does_not_resolve_github_container_registry() -> None:
repo_root = Path(__file__).resolve().parents[3]
dockerfile = (repo_root / "apps/api/Dockerfile").read_text()
assert "ghcr.io/" not in dockerfile
assert "ARG UV_VERSION=0.6.9" in dockerfile
assert 'python -m pip install --no-cache-dir "uv==${UV_VERSION}"' in dockerfile
def test_api_log_does_not_claim_skipped_executor_was_scheduled() -> None:
repo_root = Path(__file__).resolve().parents[3]
main_source = (repo_root / "apps/api/src/main.py").read_text()