[Bug] - Firefox with Jenkins inside Docker does not work
See original GitHub issueContext: Project: https://github.com/APAODUQS/playwright-demo Playwright image: mcr.microsoft.com/playwright:v1.20.1-focal Jenkins Server version: 2.277.4
#Jenkinsfile
pipeline {
agent { docker { image 'mcr.microsoft.com/playwright:v1.20.1-focal' } }
stages {
stage('e2e-tests') {
steps {
sh 'npm install'
sh 'npm run test -- --project Chrome --grep @playwright'
}
}
}
}
Describe the problem:
I am trying to run the tests from a jenkins build as the documentation indicates: https://playwright.dev/docs/ci#jenkins, but when I try to run it with the previous configuration, with the playwright docker image I get this error:

Then, when I run:
sh '''
npm install
npx playwright install chrome
npm run test -- --project Chrome --grep @playwright
'''
I get the error:

Then I tried to run it with tue command npx playwright install:
sh '''
npm install
npx playwright install
npm run test -- --project Chrome --grep @playwright
'''
And I get the same first error.
I have tried a lot of things but they still are not working. Could you help me or suggest me how I could run it?
Issue Analytics
- State:
- Created a year ago
- Comments:22 (10 by maintainers)
Top Results From Across the Web
[JENKINS-58657] sh not working inside docker container
In my scenario, there are two containers on a kubernetes pod, one is the jnlp-slave. The directory /home/jenkins/agent/workspace/<jobname>@tmp/ ...
Read more >Run TestCafe in Firefox browser using docker container via ...
I want to run the TestCafe in firefox browser(not headless) through Jenkins. I'm using docker container which has chromium and firefox ...
Read more >linuxserver/firefox - Docker Image
Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic....
Read more >How to run firefox inside docker container | Edureka Community
I have one docker container in my centos base system. But I am not able to run firefox from my container. How can...
Read more >PKIX path building failed error message
Jenkins with HTTPS causes PKIX error message. Elasticsearch task that is running in a docker fails with the following error: "PKIX path building...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Try this: https://github.com/microsoft/playwright/discussions/13716#discussioncomment-3192464
Thanks @APAODUQS! Is that output from a run in a container? If not (and theirs a display), remove the
xvfb-runbit—that’s only needed if there isn’t a display available already. That looks like a different error from https://github.com/microsoft/playwright/issues/13230#issuecomment-1086195132.Since there are now several confirmations that it works for some Jenkins Docker configurations and the surface area for configuring Jenkins and its agents is large, folks in the Jenkins community will likely be better able to help you troubleshoot.
Thanks for your patience, and feel free to post back what you find!