优化国内访问问题

This commit is contained in:
2026-10-19 00:23:28 +08:00
parent 6b40ced355
commit 4dd51ba18c
2 changed files with 28 additions and 3 deletions
+15
View File
@@ -1,5 +1,20 @@
FROM node:22-slim
# 国内构建慢:apt/pip 默认源在国外,apt-get update 能卡十几分钟。默认换成腾讯云镜像。
# 境外构建或想换源:docker compose build --build-arg DEBIAN_MIRROR=deb.debian.org
# 腾讯云 CVM 上想更快可用内网镜像 mirrors.tencentyun.com(仅腾讯云内网可达)。
ARG DEBIAN_MIRROR=mirrors.cloud.tencent.com
# 换 apt 源:bookworm 可能是 /etc/apt/sources.list,也可能是 deb822 的 /etc/apt/sources.list.d/*.sources,
# 直接用 grep 扫一遍、只替换域名,两种格式都盖住(路径 /debian、/debian-security 保持不变)。
RUN set -eux; \
files="$(grep -rl 'deb.debian.org' /etc/apt/ 2>/dev/null || true)"; \
if [ -n "$files" ]; then sed -i "s|deb.debian.org|${DEBIAN_MIRROR}|g" $files; fi; \
grep -rn "${DEBIAN_MIRROR}" /etc/apt/ | head -5 || true
# TZ=Asia/Shanghai:统一时区。
ENV TZ=Asia/Shanghai
# libssl3: officecli is a .NET self-contained binary and hard-requires libssl.
# ICU is NOT needed: DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 disables globalization.
# curl: the entrypoint fetches the officecli binary at FIRST boot (image intentionally