You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
try (Playwrightplaywright = Playwright.create();
Browserbrowser = playwright.chromium().launch(newBrowserType.LaunchOptions().setHeadless(true));
Pagepage = browser.newContext().newPage()) {
// do something with page
} catch (Exceptione) {
// 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]
The text was updated successfully, but these errors were encountered:
Hard to tell, you run some custom packages. The standard package seems to run fine in docker. If you want to skip the driver extraction step, you can pass 'playwright.cli.dir' property pointing to already installed driver's location which is probably your best bet. There is an open request for splitting the driver which is tracked in #1196, you can upvote that issue.
If you think this is an issue with standard Playwright packages, please file a new issue with a self-contained repro.
The standard package seems to run fine in docker. If you want to skip the driver extraction step, you can pass 'playwright.cli.dir' property pointing to already installed driver's location which is probably your best bet.
@yury-s How do we pre install a driver? I can't seem to locate the instructions for this, kindly please point me to any guide. Thank you.
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.jar
via Gradle'sdistribution
plugindriver-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 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
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
The text was updated successfully, but these errors were encountered: