-
Notifications
You must be signed in to change notification settings - Fork 249
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
Docker: How to build a functional Dockerfile #982
Comments
Opcion C :) : Create an image starting from the playwright one and install .NET Core there. https://playwright.dev/#version=v1.5.2&path=docs%2Fdocker%2FREADME.md&q= |
So I ended with this Dockerfile
that I run with
Anyone see a security flaw or something on it? If it's safe I can build a PR documenting it so others can use it. |
Can this be added to the Sample, would be helpful for everyone ? Spent a good day on this. :) |
The problem is the combination of versions, of Playwright and .Net. This Dockerfile is for Net Core 3.1, I have built a new one for Net 5. And you need to match the version of the Playwright image you have used with the Nuget packaged used. I see it more like a template that you adapt to your specific needs. |
Thanks pablopioli, any chance you can share that the one with .net 5 ? It does look like my company proxy is not allowing me to Run RUN apt-get install -y wget , even with the proxies. Sigh! |
We had some issues where it the .net playwright was looking for the chromium version chromium-827102 but what was actually downloaded in the container based on mcr.microsoft.com/playwright:focal was chromium-833159. We "solved" this by added a step in our docker container that copied the browser downloaded from the .net build step to the resulting container keeping them in sync.
Feels slightly iffy but we couldn't see a way to solve it in another way. Anyone can point in a better direction? Our complete docker file for context:
|
@mobstation you should keep versions in sync. So if you use pw# 0.162.0 you should do Another thing here @pablopioli, @jacobneroth. pw# seems to be working on .NET, BUT we have one outstanding bug due to a breaking change in System.Text.Json dotnet/runtime#45833 |
@kblok Ah right, that makes total sense. Thanks a lot for your help! |
Since (I guess) 0.152.0 the playwright user is already present in the Playwright image, the previous recipe does not apply anymore. It should be
The recipe still targets Playwright 1.6.2 and Net Core 3.1. The sample app I use to test it breaks on newer versions of Playwright so can't use it. Maybe because of dotnet/runtime#45833 ? Will need more time to investigate. |
And this is for Playwright 0.191 on Net 5. It´s a little different since the platform runtimes are copied at build time.
|
Currently you need to tinker the image a little if you need to use the restful mode, since there is a bug in PlaywrightSharp. See #1271 for a workaround. |
Our client only allows Debian images in their k8s, they require a gRPC service to capture PDFs from one of their in-house developed web app. This is the complete Docker file, works with both asp.net core 3.1 and 5.0. For Playwright 0.162.0 and Chromium only.
|
Closing this as a part of the triage - it does not look actionable on our side. Please file new issues for outstanding problems! |
Isn't that Option B? :P |
There is now an official image: https://playwright.dev/dotnet/docs/docker |
@pavelfeldman > Closing this as a part of the triage - it does not look actionable on our side.
|
I'm trying to understand how to run PlaywrightSharp in a docker container. I started with the basic, the Net Core image and got:
I know documentation on this topic is missing, but I would like wich is the best way to start:
Option A: The Playwright image and install Net Core dependencies
Option B: The Net Core image and install Playwright dependencies
I took a look at the Dockerfile from the Playwright project but could not make it work.
The text was updated successfully, but these errors were encountered: