build: use mainland package mirrors
Generic Container CI/CD / test-build-publish (push) Successful in 31s
Agent CI/CD / build-test-publish-and-deploy (push) Successful in 31s

This commit is contained in:
2026-08-17 19:25:38 +08:00
parent 178e74b403
commit 45687bcf67
+8 -5
View File
@@ -5,11 +5,13 @@ USER root
ARG UBUNTU_APT_MIRROR=mirrors.aliyun.com ARG UBUNTU_APT_MIRROR=mirrors.aliyun.com
ARG PYPI_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple ARG PYPI_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
ARG PYPI_TRUSTED_HOST=pypi.tuna.tsinghua.edu.cn ARG PYPI_TRUSTED_HOST=pypi.tuna.tsinghua.edu.cn
ARG NPM_REGISTRY=https://registry.npmmirror.com
ENV VIRTUAL_ENV=/opt/venv ENV VIRTUAL_ENV=/opt/venv
ENV PATH="$VIRTUAL_ENV/bin:/root/.local/bin:$PATH" ENV PATH="$VIRTUAL_ENV/bin:/root/.local/bin:$PATH"
ENV PIP_INDEX_URL=${PYPI_INDEX_URL} ENV PIP_INDEX_URL=${PYPI_INDEX_URL}
ENV PIP_TRUSTED_HOST=${PYPI_TRUSTED_HOST} ENV PIP_TRUSTED_HOST=${PYPI_TRUSTED_HOST}
ENV UV_INDEX_URL=${PYPI_INDEX_URL} ENV UV_INDEX_URL=${PYPI_INDEX_URL}
ENV BUN_CONFIG_REGISTRY=${NPM_REGISTRY}
RUN sed -i "s|http://archive.ubuntu.com|https://${UBUNTU_APT_MIRROR}|g; s|http://security.ubuntu.com|https://${UBUNTU_APT_MIRROR}|g" /etc/apt/sources.list 2>/dev/null || true && \ RUN sed -i "s|http://archive.ubuntu.com|https://${UBUNTU_APT_MIRROR}|g; s|http://security.ubuntu.com|https://${UBUNTU_APT_MIRROR}|g" /etc/apt/sources.list 2>/dev/null || true && \
sed -i "s|http://archive.ubuntu.com|https://${UBUNTU_APT_MIRROR}|g; s|http://security.ubuntu.com|https://${UBUNTU_APT_MIRROR}|g" /etc/apt/sources.list.d/*.sources 2>/dev/null || true && \ sed -i "s|http://archive.ubuntu.com|https://${UBUNTU_APT_MIRROR}|g; s|http://security.ubuntu.com|https://${UBUNTU_APT_MIRROR}|g" /etc/apt/sources.list.d/*.sources 2>/dev/null || true && \
@@ -19,14 +21,14 @@ RUN sed -i "s|http://archive.ubuntu.com|https://${UBUNTU_APT_MIRROR}|g; s|http:/
unzip \ unzip \
python3 \ python3 \
python3-venv && \ python3-venv && \
curl -LsSf https://astral.sh/uv/install.sh | sh && \
ln -s /root/.local/bin/uv /usr/local/bin/uv && \
ln -sf /usr/bin/python3 /usr/local/bin/python && \ ln -sf /usr/bin/python3 /usr/local/bin/python && \
mkdir -p /root/.config/pip && \ mkdir -p /root/.config/pip && \
printf "[global]\nindex-url = %s\ntrusted-host = %s\n" "$PIP_INDEX_URL" "$PIP_TRUSTED_HOST" > /root/.config/pip/pip.conf && \ printf "[global]\nindex-url = %s\ntrusted-host = %s\n" "$PIP_INDEX_URL" "$PIP_TRUSTED_HOST" > /root/.config/pip/pip.conf && \
uv venv "$VIRTUAL_ENV" && \ python3 -m venv "$VIRTUAL_ENV" && \
uv pip install --python "$VIRTUAL_ENV/bin/python" \ pip install \
--index-url "$UV_INDEX_URL" \ --index-url "$PIP_INDEX_URL" \
--trusted-host "$PIP_TRUSTED_HOST" \
uv \
pip \ pip \
setuptools \ setuptools \
wheel \ wheel \
@@ -37,6 +39,7 @@ RUN sed -i "s|http://archive.ubuntu.com|https://${UBUNTU_APT_MIRROR}|g; s|http:/
rich \ rich \
ipython \ ipython \
pytest && \ pytest && \
ln -s "$VIRTUAL_ENV/bin/uv" /usr/local/bin/uv && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
COPY --from=bun-bin /usr/local/bin/bun /usr/local/bin/bun COPY --from=bun-bin /usr/local/bin/bun /usr/local/bin/bun