ximus / chromium-ci

Minimal docker image to test web applications with headless Chome (Chromium)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chromium-ci

Don't trust random people on the internet telling you to disable the sandbox!

chromium-ci allows you to execute tests (e.g., using Karma) against a dockerized headless Chrome (Chromium) without disabling the sandbox.

Sample usage

docker run
    --security-opt seccomp=seccomp/chromium.json
    -v `pwd`/node-ci-demo:/app
    tkp1n/chromium
    npm run ci-test

The required seccomp config file is available in this repo and is based on the default config found here, extended with the required syscalls made by Chromium as reported here.

Testing an Angular app

You can test the barebones Angular app in this repo without any changes to the configuration of the project by running the following command inside tkp1n/chromium:

  • npm run test -- --browsers=ChromeHeadless --no-watch

Pro tip

If your application uses a lot of memory, the 64MB of shared memory with which Docker runs the container might not be enough. Run Chromium with the following parameter, to work around this issue:

  • --disable-dev-shm-usage

About

Minimal docker image to test web applications with headless Chome (Chromium)

License:MIT License


Languages

Language:HTML 72.8%Language:TypeScript 19.7%Language:JavaScript 5.2%Language:Dockerfile 2.1%Language:CSS 0.2%