You should find Puppeteer executes successfully, provided proper Chrome flags are used. Chrome will write into /tmp instead.Īdd your JavaScript to your container with a COPY instruction. disable-dev-shm-usage – This flag is necessary to avoid running into issues with Docker’s default low shared memory space of 64MB.
The fs module will allow you to write data fetched from the website into a. Inside the index.js file, we need to require puppeteer and the fs (file system) module.
This is where we will be writing our code to download images from the Bannerbear page. If you’re uncomfortable with this, you’ll need to manually configure working Chrome sandboxing, which is a more involved process. In the same project, create index.js file. It’s vital you ensure your Docker containers are strongly isolated from your host. Using these flags could allow malicious web content to escape the browser process and compromise the host.