Version
1.45.0
Steps to reproduce
Context
This is how we use Playwright in our application:
try (Playwright playwright = Playwright.create();
Browser browser = playwright.chromium().launch(new BrowserType.LaunchOptions().setHeadless(true));
Page page = browser.newContext().newPage()) {
// do something with page
} catch (Exception e) {
// throw e
}
However the JAR of our application became too large for our CI/CD pipeline due to Playwright - we noticed this is due to the drivers which includes for all supported OS, thus we did a Gradle workaround to only include the drivers we need (we used this as reference).
- In our
build.gradle, we repackaged driver-bundle.jar via Gradle's distribution plugin
- From 163 MB, we were able to size down the
driver-bundle.jar to 63 MB by only retaining the Linux drivers.
Expected behavior
When our application is run locally like via IDE, we are able to use Playwright without any issues.
Actual behavior
However if we run our app in Docker and invoked the API that uses Playwright, we encountered this error:

We then applied permissions to the /tmp/ folder via the Dockerfile
RUN chmod g+s /tmp/
RUN chown -R 1000:1000 /tmp/
but still we receive the same error. That's when we noticed that the playwright-java-*** folder below is actually only created during the first instance Playwright.create() is invoked, as it only initializes the driver by then.

We tried manually invoking the said node program inside the Docker instance and we received the same error as the logs.
What is the problem here? Is it because of our container using Alpine?
Additional context
No response
Environment
- Operating System: [Alpine Linux via Docker]
- Browser: [Chromium]
- Java Version: [17]
- Gradle Version: [8.1.1]
Version
1.45.0
Steps to reproduce
Context
This is how we use Playwright in our application:
However the JAR of our application became too large for our CI/CD pipeline due to Playwright - we noticed this is due to the drivers which includes for all supported OS, thus we did a Gradle workaround to only include the drivers we need (we used this as reference).
build.gradle, we repackageddriver-bundle.jarvia Gradle'sdistributionplugindriver-bundle.jarto 63 MB by only retaining the Linux drivers.Expected behavior
When our application is run locally like via IDE, we are able to use Playwright without any issues.
Actual behavior
However if we run our app in Docker and invoked the API that uses Playwright, we encountered this error:

We then applied permissions to the
/tmp/folder via the Dockerfilebut still we receive the same error. That's when we noticed that the

playwright-java-***folder below is actually only created during the first instancePlaywright.create()is invoked, as it only initializes the driver by then.We tried manually invoking the said
nodeprogram inside the Docker instance and we received the same error as the logs.What is the problem here? Is it because of our container using Alpine?
Additional context
No response
Environment