fix(deploy): keep BuildKit cache and use Huawei mirrors for API images
Independent Staging Quality Gate / validate (push) Successful in 10m36s
Independent Staging Quality Gate / publish (push) Successful in 7m7s

Gitea run 2828 validated, then publish hit the 60-minute deadline while
Aliyun apt/pip crawled at about 22 kB/s after a 72h cache prune on a
runner with 677 GiB free. Skip BuildKit prune when disk is above the
minimum, split API apt/pip layers, and point apt/pypi at Huawei Cloud.
This commit is contained in:
jesse-ux
2026-09-21 10:56:38 +08:00
parent 27a6c39b94
commit 0c3c9d6b42
5 changed files with 63 additions and 21 deletions
+7 -4
View File
@@ -2,15 +2,18 @@ FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/python:3.12-slim
ENV PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/ \
PIP_INDEX_URL=https://mirrors.huaweicloud.com/repository/pypi/simple/ \
PIP_DEFAULT_TIMEOUT=60
WORKDIR /app
COPY requirements.txt deploy/patch_vedastro_update_check.py ./
RUN sed -i 's|http://deb.debian.org|https://mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources \
# Apt packages are their own layer so a later pip timeout can reuse them.
# Huawei mirrors share the SWR path already used for the base image; Aliyun
# debian/pypi at ~22 kB/s cannot finish this RUN inside the 60-minute publish job.
RUN sed -i 's|http://deb.debian.org|https://mirrors.huaweicloud.com|g' /etc/apt/sources.list.d/debian.sources \
&& apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 update \
&& apt-get install -y --no-install-recommends build-essential nodejs \
&& python -m pip install -r requirements.txt \
&& apt-get install -y --no-install-recommends build-essential nodejs
RUN python -m pip install -r requirements.txt \
&& python patch_vedastro_update_check.py \
&& apt-get purge -y --auto-remove build-essential \
&& rm -rf /var/lib/apt/lists/*