DEV Community


Cannot launch puppeteer browser instance in docker image

saiavinashiitr profile image Sai Avinash Duddupudi ・1 min read

Hi all,

I am trying a launch a headless chrome and perform some actions using puppeteer in my Nodejs code.

This works great(with npm start) but when I try to build Docker image from Docker file and run the image and execute the function, I get the following error.

(node:18) UnhandledPromiseRejectionWarning: Error: Unable to launch browser, error message: Failed to launch the browser process!
[0422/] No usable sandbox! Update your kernel or see for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.

Enter fullscreen mode Exit fullscreen mode

So, after some search, I found that adding args: ["--no-sandbox"] during browser launch will solve the problem but still the same error keeps coming.

Here is my Dockerfile.

Please suggest a workaround

Discussion (0)

Forem Open with the Forem app