Sign inSign up

kchason/nodejs-chrome

By kchason

•Updated over 6 years ago

A NodeJS image with Chrome installed for Angular Karma tests in CI processes.

Image
0

1.9K

kchason/nodejs-chrome repository overview

Provides a vanilla NodeJS (https://hub.docker.com/_/node/⁠) image with Google Chrome installed on it for CI testing without having to re-install it every time.

Example usage with Angular 8:

const isDocker = require('is-docker')();

module.exports = function (config) {
  config.set({
       ...
       browsers: ['ChromeCustom'],
    customLaunchers: {
      ChromeCustom: {
        base: 'ChromeHeadless',
        // We must disable the Chrome sandbox when running Chrome inside Docker (Chrome's sandbox needs
        // more permissions than Docker allows by default)
        flags: isDocker ? ['--no-sandbox'] : []
      }
    },
    singleRun: true,
    restartOnFileChange: false
  });
};

Then ng test is able to utilize the ChromeHeadless environment. Docker does not let it be run without --no-sandbox which is was drove the addition of the isDocker check.

Tag summary

Content type

Image

Digest

Size

153.7 MB

Last updated

over 6 years ago

docker pull kchason/nodejs-chrome