Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running in docker broken #76

Open
henryiii opened this issue Mar 24, 2020 · 3 comments
Open

Running in docker broken #76

henryiii opened this issue Mar 24, 2020 · 3 comments

Comments

@henryiii
Copy link

This currently fails to work in docker with:

npx svgexport  /tmp/tmp-2951T7QQRqKpEt1U/d58cc138.svg x.png
(node:3110) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
[0324/153017.535388:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

If the line in render.js var browser = await puppeteer.launch(); is replaced with var browser = await puppeteer.launch({args: ['--no-sandbox']});, then it works. Could this either detect it is running as root (such as in a docker image) or a way to pass args (via environment variables) be added? This is breaking a gitbook GitLab CI using the node:10 image.

@henryiii
Copy link
Author

@MichaelRoosz
Copy link
Collaborator

MichaelRoosz commented Mar 24, 2020

Because of security reasons it is not recommend to run docker or svgexport /pupeteer as root. If you switch to a different user for docker it will work.

@henryiii
Copy link
Author

Can you do that in CI? You don't have control over how it sets up the docker run, AFAIK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants