diff --git a/Dockerfile.base b/Dockerfile.base index eb94471..3cbb3ce 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -478,9 +478,10 @@ RUN curl -fsSL --retry 5 --retry-delay 5 --retry-all-errors https://deb.nodesour # Playwright honours PLAYWRIGHT_BROWSERS_PATH, so we place the browser under # /usr/local/share (never shadowed) and hand agent-browser a STABLE symlink # via AGENT_BROWSER_EXECUTABLE_PATH — the symlink insulates the ENV from -# Playwright's per-version `chromium-` directory name (glob picks the -# real headful build; the `chromium_headless_shell-*` dir has an underscore -# so `chromium-*` never matches it). +# Playwright's per-version, per-ARCH browser directory (`chrome-linux` on arm64, +# `chrome-linux64` on amd64 — Chrome-for-Testing), so we `find` the `chrome` +# binary rather than hardcode the path; the headless-shell binary is named +# `chrome-headless-shell`, so `-name chrome` skips it. # # `playwright install --with-deps chromium` also apt-installs Chromium's # runtime libs; verified to resolve correctly on Debian trixie (exit 0 — the @@ -499,9 +500,8 @@ RUN NPM_CONFIG_PREFIX=/usr npm install -g \ "agent-browser@${AGENT_BROWSER_VERSION}" \ "playwright@${PLAYWRIGHT_VERSION}" && \ playwright install --with-deps chromium && \ - for chrome in "${PLAYWRIGHT_BROWSERS_PATH}"/chromium-*/chrome-linux/chrome; do \ - ln -sf "$chrome" /usr/local/bin/agent-chrome; break; \ - done && \ + CHROME="$(find "${PLAYWRIGHT_BROWSERS_PATH}" -type f -name chrome -path '*/chromium-*/*' | head -n1)" && \ + [ -n "$CHROME" ] && ln -sf "$CHROME" /usr/local/bin/agent-chrome && \ agent-browser --version && \ test -x "$(readlink -f /usr/local/bin/agent-chrome)" && \ rm -rf "${PLAYWRIGHT_BROWSERS_PATH}"/chromium_headless_shell-* && \