Skip to content

feat(docker): pre-extract the driver in images to avoid /tmp unpacking#1938

Open
yury-s wants to merge 1 commit into
microsoft:mainfrom
yury-s:docker-preinstall-driver
Open

feat(docker): pre-extract the driver in images to avoid /tmp unpacking#1938
yury-s wants to merge 1 commit into
microsoft:mainfrom
yury-s:docker-preinstall-driver

Conversation

@yury-s

@yury-s yury-s commented Jun 19, 2026

Copy link
Copy Markdown
Member

Summary

  • The official images now extract the driver once at build time and reuse it at runtime, so the library no longer unpacks the Node.js binary and playwright-core package into /tmp on every Playwright.create() — addressing the immutable-infra concern in [Feature] Java library poor playwright/java docker image integration #1268.
  • New CLI install-driver [dir] command extracts the driver (the playwright-core package + the host Node.js binary) into a fixed directory.
  • New PLAYWRIGHT_DRIVER_DIR environment variable (env equivalent of the playwright.cli.dir system property) points Playwright at a preinstalled driver directory via PreinstalledDriver — zero extraction.
  • Dockerfiles (jammy/noble/resolute) run install-driver at build into /ms-playwright-driver and bake PLAYWRIGHT_DRIVER_DIR for runtime.

Notes

  • The bundled, version-matched host Node.js is the single node that gets pre-extracted, so no separate Node.js install is needed.
  • Verified: install-driver produces a self-contained package/cli.js + node; with PLAYWRIGHT_DRIVER_DIR set, driverDir is that path (no /tmp) and Chromium launches. TestInstall covers the extract-and-reuse flow.
  • Did not run an actual docker build here; the Java side is verified end-to-end and the Dockerfile edits mirror the existing install steps.

Fixes #1268

Add a CLI `install-driver` command that extracts the driver (the playwright-core
package and the host Node.js binary) into a fixed directory, and a
PLAYWRIGHT_DRIVER_DIR environment variable that points Playwright at a
preinstalled driver directory (PreinstalledDriver, no extraction). The official
Docker images now extract the driver once at build time and select it at
runtime, so the library no longer unpacks executables into /tmp on every launch.

Fixes: microsoft#1268
@yury-s yury-s requested review from dcrousso and dgozman June 19, 2026 21:36
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.

[Feature] Java library poor playwright/java docker image integration

1 participant