DEV Community

Discussion on: How to use Puppeteer inside a Docker container

Collapse
 
cory_k profile image
Cory

Thank you for this, it got me unstuck. Do you know if installing the latest Google Chrome could lead to problems if using an older version of Puppeteer? How to avoid this?

Collapse
 
navarroaxel profile image
Axel Navarro Cloud(x);

Yep, puppeteer is tested with a specific version of Chromium, details here: pptr.dev/chromium-support.

Also in each release you can see that version: github.com/puppeteer/puppeteer/rel....

You can check the available version starting a container with:

docker run --rm -it node:18-slim bash
Enter fullscreen mode Exit fullscreen mode

And then these commands for chromium or google-chrome-stable:

$ apt-get update && apt list --all-versions chromium

# Add the apt repo for Google Chrome
$ apt update && apt install curl gnupg -y \
  && curl --location --silent https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
  && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
  && apt update

$ apt list --all-versions google-chrome-stable
Enter fullscreen mode Exit fullscreen mode

For node:18-slim you'll see this output:

google-chrome-stable/stable 104.0.5112.101-1 amd64
chromium/stable-security 104.0.5112.101-1~deb11u1 amd64
chromium/stable 103.0.5060.53-1~deb11u1 amd64
Enter fullscreen mode Exit fullscreen mode

Just look for a puppeteer version that works fine with the given Chromium version.