A Node + Puppeteer base image for running Puppeteer scripts. Add your own tools (such as Jest, Mocha, etc), link services you want to test via Docker Compose, and run your Puppeteer scripts with a headless Chromium.
See the list of Docker Hub tags for Puppeteer versions available.
docker buildx build --platform=linux/amd64 .
To use the docker image directly, run:
docker run -i --init --cap-add=SYS_ADMIN --rm touch4it/puppeteer:latest node -e "$(cat path/to/script.js)"
where path/to/script.js is the path relative to your working directory. Note the image requires the SYS_ADMIN capability since the browser runs in sandbox mode.
Further information: https://pptr.dev/guides/docker
See the example directory for a complete Docker Compose example, showing how to run Puppeteer against a linked Docker Compose web service.
- Create a new release on GitHub. The image is tagged with the same version as Puppeteer.
- Docker Hub automatically builds images for the tag.
- There is no step 3.
Forked from BuildKite Puppeteer repository
Updated Dockerfile from official Puppeteer repository