fix(docker): 用 NodeSource 装 Node 20(Playwright 要求 >=20)
bookworm 自带的 apt nodejs 是 18.20.4,Playwright 全局安装报 "requires Node.js 20 or higher" 导致镜像构建失败。改为从 NodeSource 装 20.x(自带 npm),移除 apt 的 nodejs/npm。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
3f798ec74e
commit
0f94849012
1 file changed
+4
-2
+4
-2
@@ -12,11 +12,13 @@
|
|||||||
# docker build -t artex:local .
|
# docker build -t artex:local .
|
||||||
FROM python:3.12-slim-bookworm
|
FROM python:3.12-slim-bookworm
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
# 常用工具:ripgrep / curl / vim / npm,加一批 recon 常备件(按需增删)
|
# 常用工具:ripgrep / curl / vim,加一批 recon 常备件(按需增删)。
|
||||||
|
# Node 从 NodeSource 装 20.x:bookworm 自带的 apt nodejs 是 18,Playwright 要求 >=20。
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
ca-certificates ripgrep curl wget vim git jq unzip \
|
ca-certificates ripgrep curl wget vim git jq unzip \
|
||||||
nodejs npm \
|
|
||||||
dnsutils iputils-ping netcat-openbsd whois nmap \
|
dnsutils iputils-ping netcat-openbsd whois nmap \
|
||||||
|
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
||||||
|
&& apt-get install -y --no-install-recommends nodejs \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
# 预装 Playwright MCP 与 CLI(全局),运行时不再 npx 联网下载。
|
# 预装 Playwright MCP 与 CLI(全局),运行时不再 npx 联网下载。
|
||||||
# @playwright/mcp:browser MCP 直接 `npx @playwright/mcp`(已全局装好,无需 -y/@latest)。
|
# @playwright/mcp:browser MCP 直接 `npx @playwright/mcp`(已全局装好,无需 -y/@latest)。
|
||||||
|
|||||||
Reference in new issue
Block a user