fix(docker): make ubuntu apt mirror optional
Agent CI/CD / docker-image (push) Successful in 3m48s
Agent CI/CD / deploy-fallback-log (push) Has been skipped

This commit is contained in:
2026-07-17 17:59:01 +08:00
parent 78f9f6fb42
commit d7faaa2ecb
+5 -3
View File
@@ -1,6 +1,6 @@
FROM smanx/opencode:latest AS base FROM smanx/opencode:latest AS base
USER root USER root
ARG UBUNTU_APT_MIRROR=mirrors.aliyun.com ARG UBUNTU_APT_MIRROR=
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
ENV VIRTUAL_ENV=/opt/venv ENV VIRTUAL_ENV=/opt/venv
@@ -11,8 +11,10 @@ ENV UV_INDEX_URL=${PYPI_INDEX_URL}
COPY vendor/bun-linux-x64.zip /tmp/bun.zip COPY vendor/bun-linux-x64.zip /tmp/bun.zip
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 if [ -n "${UBUNTU_APT_MIRROR}" ]; then \
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 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; \
fi && \
apt-get update && apt-get install -y --no-install-recommends \ apt-get update && apt-get install -y --no-install-recommends \
curl \ curl \
jq \ jq \