Cannot pass engine-options in backstopJS config file
- Dominant language
- JavaScript
- Stars
- 7.2k
- Forks
- 621
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to run headless chrome in an Alpine docker container to run tests with BackstopJS. I'm giving the --no-sandbox and '--disable-setuid-sandbox' arguments to puppeteer but it's still giving me this error when running from root:
`Running as root without --no-sandbox is not supported.`
or when running as non-root user:
`Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted`
I'm not sure what i could be doing wrong since I'm giving the correct arguments to my backstopJS config.
BackstopJS config:
```
...
engine: 'puppet',
engineOptions: {
headless: true,
args: ['--no-sandbox', '--disable-setuid-sandbox'],
},
...
```
Dockerfile:
```
FROM node:14.17.1-alpine
VOLUME /var/www
WORKDIR /var/www
RUN apk update && apk add --no-cache git openssh curl chromium
RUN yarn global add bower
RUN yarn global add ember-cli
COPY install.sh /root/
RUN chmod u+x /root/install.sh
COPY fix-uid.sh /root/
RUN chmod u+x /root/fix-uid.sh && /root/fix-uid.sh
RUN ln -s /usr/bin/chromium-browser /usr/bin/chrome
RUN apk add --no-cache \
chromium \
nss \
freetype \
harfbuzz \
ca-certificates \
ttf-freefont \
nodejs \
yarn
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
RUN yarn add puppeteer@13.5.0
CMD ember s
```
Contributor guide
Assessment
This issue has not been assessed yet.