diff --git a/infra/docker/worker.Dockerfile b/infra/docker/worker.Dockerfile index a6ec11baf..6779c2304 100755 --- a/infra/docker/worker.Dockerfile +++ b/infra/docker/worker.Dockerfile @@ -10,19 +10,13 @@ FROM xiaoxia-registry.cn-hangzhou.cr.aliyuncs.com/xiaoxiakeji/saas-worker-base:l # 构建参数:版本号(CI 传入 commit hash) ARG APP_VERSION=dev -# 使用阿里云镜像加速 -RUN sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources 2>/dev/null || \ - sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list 2>/dev/null || true - # CJK 字体保障:确保 fonts-noto-cjk 已安装(base 镜像漂移兜底)+ 重建字体缓存 -# 验证 fc-match 能正确解析 Noto Sans CJK SC,避免 PIL 直读 ttf 兜底 -RUN apt-get update && apt-get install -y --no-install-recommends \ - fonts-noto-cjk \ - fontconfig \ +# fc-cache 非致命;fc-match 结果只打日志用于排查,不阻断构建 +RUN apt-get update && (apt-get install -y --no-install-recommends fonts-noto-cjk fontconfig || true) \ && rm -rf /var/lib/apt/lists/* \ - && fc-cache -fv \ - && fc-match 'Noto Sans CJK SC' | grep -qi 'noto' \ - && echo "[font] fc-match Noto Sans CJK SC: $(fc-match 'Noto Sans CJK SC' | head -1)" + && (fc-cache -fv || true) \ + && echo "[font] fc-match sans:zh: $(fc-match -f '%{family}\n' sans:zh 2>/dev/null | head -1)" \ + && echo "[font] fc-match Noto Sans CJK SC: $(fc-match 'Noto Sans CJK SC' 2>/dev/null | head -1)" # 创建非 root 用户 RUN groupadd -r celery \