From e0e3419edb230bfc8d504261e8eabb36b7c69bd1 Mon Sep 17 00:00:00 2001 From: yyhuni Date: Thu, 8 Jan 2026 08:14:24 +0800 Subject: [PATCH] chore(docker): improve worker dockerfile reliability with retry mechanism - Add retry mechanism for apt-get install to handle ARM64 mirror sync delays - Use --no-install-recommends flag to reduce image size and installation time - Split apt-get update and install commands for better layer caching - Add fallback installation logic for packages in case of initial failure - Include explanatory comment about ARM64 ports.ubuntu.com potential delays - Maintain compatibility with both ARM64 and AMD64 architectures --- docker/worker/Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docker/worker/Dockerfile b/docker/worker/Dockerfile index f0ee48de..4f75c57e 100644 --- a/docker/worker/Dockerfile +++ b/docker/worker/Dockerfile @@ -45,7 +45,9 @@ ENV DEBIAN_FRONTEND=noninteractive WORKDIR /app # 1. 安装基础工具和 Python -RUN apt-get update && apt-get install -y \ +# 注意:ARM64 使用 ports.ubuntu.com,可能存在镜像同步延迟,需要重试机制 +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ python3 \ python3-pip \ python3-venv \ @@ -64,6 +66,9 @@ RUN apt-get update && apt-get install -y \ libnss3 \ libxss1 \ libasound2t64 \ + || (rm -rf /var/lib/apt/lists/* && apt-get update && apt-get install -y --no-install-recommends \ + python3 python3-pip python3-venv pipx git curl wget unzip jq tmux nmap masscan libpcap-dev \ + ca-certificates fonts-liberation libnss3 libxss1 libasound2t64) \ && rm -rf /var/lib/apt/lists/* # 安装 Chromium(通过 Playwright 安装,支持 ARM64 和 AMD64)