docs: change the Alpine Docker example to use env instead of launch option (#5666)

This commit is contained in:
Ryō Igarashi 2020-04-17 18:30:26 +09:00 committed by GitHub
parent 20c22ad9ad
commit 35fc65492d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -341,7 +341,8 @@ RUN apk add --no-cache \
...
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
# Puppeteer v1.19.0 works with Chromium 77.
RUN yarn add puppeteer@1.19.0
@ -358,14 +359,6 @@ USER pptruser
...
```
And when launching Chrome, be sure to use the `chromium-browser` executable:
```js
const browser = await puppeteer.launch({
executablePath: '/usr/bin/chromium-browser'
});
```
#### Tips
By default, Docker runs a container with a `/dev/shm` shared memory space 64MB.