question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to launch --headless on Docker or wercker?

See original GitHub issue

Hi. I want to run ChromeHeadless on CI services.

I could not launch google-chrome --headless because the following error:

Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted

Is there some workarounds?

I tried to run in local env(macOS Chrome canary), and it works well.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

41reactions
hoeckcommented, Jul 3, 2017

There is no need to start a privileged container, turning off the chrome sandbox with --no-sandbox is enough. Added the following to my karma.conf.js:

    browsers: ['ChromeHeadlessNoSandbox'],
    customLaunchers: {
        ChromeHeadlessNoSandbox: {
            base: 'ChromeHeadless',
            flags: [
                '--no-sandbox', // required to run without privileges in docker
                '--user-data-dir=/tmp/chrome-test-profile',
                '--disable-web-security'
            ]
        }
    },
12reactions
andybrycommented, May 7, 2017

Hi,

I was getting this issue as well. For me adding the --privileged flag when running docker run resolved the issue.

The complete command I ran when starting the Docker container was: docker run -it --privileged -v $(pwd):${MOUNT_POINT} ${DOCKER_IMAGE} bash

Hope that helps you too!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use Puppeteer inside a Docker container
The browser installation via apt will resolve the required dependencies to run a headless browser inside a Docker container without any manual ...
Read more >
How to set up a Headless Chrome Node.js server in Docker
After running the Docker build, we get our Chromium executable: /usr/bin/chromium-browser . This should be our main Puppeteer Chrome executable ...
Read more >
Running Headless Chrome with Puppeteer and Docker
In this post, I'd like to introduce my take on a quick dockerized Puppeteer development environment, to work with the Headless Chrome Node...
Read more >
Configure Docker for Headless Browser setup in Linux
Step 2 in the Linux setup for the ServiceNow® Headless Browser for ATF: Configure Docker Server to authenticate all requests.
Read more >
How to run google chrome headless in docker? - Stack Overflow
The command used in that container to launch headless chrome is this: ... docker run -it --rm -p=0.0.0.0:9222:9222 \ --name=chrome-headless ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found