fix(docker): retry apt-get to tolerate transient proxy 502s
构建时遇到 'E: Failed to fetch ... 502 Bad Gateway [IP: 127.0.0.1 7890]': 经代理拉 Debian 包偶发上游抖动。给三处 apt-get 统一加 Acquire::Retries=5 与 http 超时,避免一次网络抖动就让整个 (含耗时较久的 SearXNG 构建阶段)前功尽弃。
This commit is contained in:
@ -25,7 +25,8 @@ ENV https_proxy=${HTTPS_PROXY}
|
||||
ENV HTTP_PROXY=${HTTP_PROXY}
|
||||
ENV HTTPS_PROXY=${HTTPS_PROXY}
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
RUN apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=30 update \
|
||||
&& apt-get -o Acquire::Retries=5 install -y --no-install-recommends \
|
||||
python3 python3-pip python3-venv git ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
@ -41,7 +42,8 @@ RUN git clone --depth 1 https://github.com/searxng/searxng.git /src/searxng \
|
||||
# 供 /extension/install.html 下载(Chromium 用 zip,Firefox 用 xpi)
|
||||
FROM debian:bookworm-slim AS extpack
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends zip ca-certificates \
|
||||
RUN apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=30 update \
|
||||
&& apt-get -o Acquire::Retries=5 install -y --no-install-recommends zip ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY extension/chrome /src/chrome
|
||||
@ -56,7 +58,8 @@ FROM debian:bookworm-slim
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
RUN apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=30 update \
|
||||
&& apt-get -o Acquire::Retries=5 install -y --no-install-recommends \
|
||||
nginx python3 supervisor curl ca-certificates git \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
Reference in New Issue
Block a user