New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question]: Correct way to install browsers in dockerfile with playwright.ps1 #2058
Comments
Turns out I was installing the wrong thing.... it should be chromium, not chrome.
|
@braidenstiller thank you for this, I've been struggling to get a working docker image and this has really helped me! 🥇 |
@braidenstiller thanks for sharing such a useful script. |
@ianrathbone @aaronamm Hey, glad I could help! I haven't tested this exact dockerfile below but I've copied the NodeJS parts in ad-hoc. In my testing, I found it shaved a few minutes off my build pipeline, with the added benefit of a slightly nicer looking dockerfile. Enjoy!
|
@braidenstiller could you help me, please? I'm a newbie in docker.
my dockerfile
|
Focal is the codename for Ubuntu 20.04. Jammy is 22.04. Alpine is not supported see here. See also here our official Docker image and Dockerfile. Regarding 2. its probably caused by an unsupported OS or outdated Playwright version. |
Thx for answer!
When I tried to use .Net 7 with
I saw it but can't understand how to use it, sorry for my low-skill in Docker. Is it mean that I should use
I use the latest version |
@braidenstiller I'm afraid this no longer appears to work with the error I have tried running
on a clean windows aspnet:6.0-focal base image as I get the same error
|
Try the version using NPM instead to install playwright. This ended up being quicker at build time as well. |
This is how I solved the problem |
Your question
Hi, I have recently upgraded playwright to v1.19.1 and noticed the playwright cli tool has been replaced with the playwright.ps1 script. I setup, build and run my runtime through a dockerfile based on the auto-generated .net dockerfile template and I have added:
RUN pwsh /app/build/playwright.ps1 install chrome
.Full dockerfile:
This successfully executes but when I run my container I still recieving the following error from playwright:
What is the correct way to install/run the install script in a dockerfile? I understand playwright has a base image but I would prefer to install the dependencies into my docker image instead.
The text was updated successfully, but these errors were encountered: