Skip to content

fix: use Playwright official image for ARM64 Docker#689

Open
yjnzzg2014-maker wants to merge 3 commits into
xpzouying:mainfrom
yjnzzg2014-maker:fix/655-arm64-docker-chrome
Open

fix: use Playwright official image for ARM64 Docker#689
yjnzzg2014-maker wants to merge 3 commits into
xpzouying:mainfrom
yjnzzg2014-maker:fix/655-arm64-docker-chrome

Conversation

@yjnzzg2014-maker

Copy link
Copy Markdown

Summary

Use Playwright's official image for ARM64 Docker builds instead of manual Chromium installation.

Changes

  1. Dockerfile.arm64: Simplified to use mcr.microsoft.com/playwright:v1.50.0-jammy which includes Chromium ARM64
  2. docker/build.sh: New script for auto architecture detection and build
  3. docker/docker-compose.arm64.yml: New compose file for ARM64 local builds
  4. docker/docker-compose.yml: Removed Chrome-specific environment variable

Problem

The previous Dockerfile tried to install Chromium dependencies manually but didn't actually install Chromium, relying on go-rod to auto-download it. This approach was unreliable for ARM64.

Solution

Use Playwright's official image which includes a properly configured Chromium for ARM64.

Testing

cd docker
./build.sh
docker compose -f docker-compose.arm64.yml logs -f

Fixes #655

Ensure inputSchema includes properties: {} for tools that take no
arguments. This fixes compatibility with strict MCP clients that
validate JSON Schema.

Fixes xpzouying#677
This test requires a real browser environment and was causing
go test ./... to panic when run in environments without a browser.

Fixes xpzouying#652
- Replace manual Chromium installation with Playwright's official
  mcr.microsoft.com/playwright image which includes Chromium ARM64
- Add docker/build.sh script for auto architecture detection
- Add docker/docker-compose.arm64.yml for ARM64 builds
- Update docker-compose.yml to remove Chrome-specific environment

Fixes xpzouying#655
@kimi-agent-bot

Copy link
Copy Markdown
Contributor

🔍 Kimi Code Agent 正在自动审查此 PR...

@kimi-agent-bot

Copy link
Copy Markdown
Contributor

我来先获取 PR #689 的详细信息和代码变更。

PR #689 代码审查

总体评价

这是一个有价值的改进,主要解决了 ARM64 Docker 构建中 Chromium 安装不可靠的问题。整体倾向:Approve with suggestions


变更概览

文件 变更 评价
Dockerfile.arm64 大幅重构,改用 Playwright 官方镜像 核心改进,方向正确
docker/build.sh 新增架构自动检测构建脚本 实用,提升用户体验
docker/docker-compose.arm64.yml 新增 ARM64 compose 配置 合理
docker/docker-compose.yml 移除 ROD_BROWSER_BIN 环境变量 ⚠️ 需确认对 x86_64 影响
mcp_server.go 引入 NoArgs 修复无参数工具 schema 合理,但与 PR 主题无关
xiaohongshu/search_test.go 跳过筛选测试 与 PR 主题无关

详细审查意见

1. ✅ Dockerfile.arm64 简化方向正确

将 Ubuntu + 手动安装数十个依赖的方案,替换为官方 Playwright 镜像,显著提升了可维护性。原方案依赖 go-rod 自动下载 Chromium,在 ARM64 上确实经常出问题。

2. ⚠️ 建议关注:Playwright 镜像版本与 Chromium 路径的绑定

ENV ROD_BROWSER_BIN=/ms-playwright/chromium-1155/chrome-linux/chrome

这里的 chromium-1155 与 Playwright `v1.50.0

@yjnzzg2014-maker

Copy link
Copy Markdown
Author

👋 这个 PR 修复 issue #655。使用 Playwright 官方镜像替代手动安装 Chromium,解决 arm64 Docker 环境下的 Chrome 问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant