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
Publish docker images #3072
Comments
@ravishivt what do you want to be in the image? The one we currently use for Cirrus is just a set of dependencies to make Chromium work: Dockerfile.linux. Is it valuable enough for you? +cc @fkorotkov: |
Ideally, the Dockerfile would match what's recommended in the official docs. That looks to have more best practices followed, uses node-slim for a smaller image, and actually has puppeteer installed and ready to go. My thought is to build the doc's Dockerfile in an automated process (e.g. Cirrus) and push it to GCR. |
@ravishivt how would you want to run your pptr scripts against the container? The current dockerfile cats the file and passes it in like this:
Which is not great IMO. Maybe we can do this using a mount point instead. Not sure the best practice for "passing in" files to a docker container. |
@ebidel I agree with you that mount points are more common. However, the Dockerfile wouldn't specify those volume mounts because it can only mount what's available at build time, not run time. More common than the
btw, my (selfish) goal is to create a Dockerfile for rendertron which would extend the official puppeteer image that I'm requesting here, i.e. |
Is there an official docker image for puppeteer available now?If not, is there a plan? |
@aslushnikov having an image that is just the file Dockerfile.linux is very valuable as :
Anyone can push such image but the question is if anyone will maintain it. |
I've built a docker image based on the docker.linux here,hope anyone would like to use |
@nicosmaris we currently use Docker images to run tests on Cirrus CI: Dockerfile.linux. It is guaranteed that tip-of-tree Puppeteer works with this image. |
Having an official Debian-based Docker image coupled to the specific Chromium version that is guaranteed to work properly with each specific Puppeteer release would be paramount. Currently, it's quite difficult to get it working with the compatible Chromium version in major Linux distribution unless you build Chromium from source. |
Yes, an official distribution of maintained puppeteer docker images in a docker registry would we awesome! I understand that the puppeteer project itself uses |
@WeihanLi thanks for sharing the image. Unfortunately, many companies won't be able to use a personal image like this purely based on risk. This would be mitigated by an official docker image from the project maintainers. |
@ericis Yeah, totally agree, hope for an official puppeteer docker image also |
I would like to revive this Feature Request The use cases I can identify for an official base image are:
Regarding 2.: I am the Product Manager for Google Cloud Run, and I would like to make it easier for Cloud Run developers to use Puppeteer. Today, the issue is that developers have to google for a Dockerfile and copy paste it. Personally, I had to try 2 different Dockerfiles before finding one that actually worked. It would be helpful if instead of copy pasting a Dockerfile, developers could build on top of an official container base image. At minimum, I would expect a Debian base image tagged for every published puppeteer versions. On top of that, a A version with Chromium would be a great start, and we can imagine later a version with Firefox (as requested in #7242) Regarding hosting the container image, the obvious choice is DockerHub which is very popular but comes with rate limits. The team could also consider offering a public image in Google Cloud Artifact Registry (which is the successor of Container Registry). |
I'm interested in this too, but I think that some of the assumptions made around mounting or mapping volumes is unnecessary. I agree with what @steren said, you could run the container directly and then connect to it using docker run -p 3000:3000 puppeteer/chrome:latest Chromium is now running, so we can connect. Our script (run locally, not inside the container) runs as normal: const browser = await puppeteer.connect({ browserWSEndpoint: 'ws://localhost:3000' }); I've also added #8272 which would support launching Chromium in the docker image directly. I think this would just make the whole approach to using Puppeteer in a docker environment completely seamless. |
We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days. |
Ping, I would still very much like for this to exist :) |
Looks like the official Docker image is now available via #8315, big thanks to @OrKoN! That should unlock the possibility of releasing the official image as part of the general release cycle. I think publishing to GitHub image registry should be enough, as Docker Hub requires a subscription these days. Instructions are very straightforward: https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-github-packages |
Ha! It looks like this is already in progress and/or done! https://github.com/puppeteer/puppeteer/blob/main/.github/workflows/publish-docker.yml |
Yeah, we are testing the automatic publishing right now. The image should be available soon! |
Thanks, for completeness, can you capture here the URL of the published docker image? Note that DockerHub would probably still be the de-facto place for developers to look for this image. |
We will probably only publish to GitHub registry for now. Let me keep this issue opened as I am actually still working on the docs update. |
Great news on getting the package published. I have a small suggestion: can the published package be changed from Unless the plan is to have both browsers in the same image? |
Currently, we don't have plans for publishing the image containing Firefox as the Firefox support is still experimental. Perhaps the Mozilla team might want to publish an image containing Firefox later. So if that happens, we would likely to install all supported browsers into |
In #2181, there was discussion on publishing puppeteer-compatible docker images in Cirrus CI. This would be very convenient to have automated images built and readily available.
Publishing to GCR through Google's official google-container repository would make the most sense, given this is a Google project. Docker Hub is also an option.
The text was updated successfully, but these errors were encountered: