Skip to content

Dockerfile created for Angular application continuous integration. Contains Node + Chromium + JRE 8

License

Notifications You must be signed in to change notification settings

guiebitt/docker-node-chromium-jre8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Docker image: Node + Chrome + JRE8

Dockerfile created for Angular application continuous integration. It contains Node + Chromium + JRE 8 and npm run command like Entrypoint.

Node Chromium Chromium Driver JRE 8

How to use?

  • Create a container to this image with command to run in your package.json:

    # Container name: ci-build
    # Script in package.json: build:ci
    docker create --name ci-build guieb/node-chromium-jre8 build:ci
  • Copy your source code to this container (put in /sources):

    # Source code: . (current directory in bash)
    # <Container name>/sources: ci-build:/sources
    docker cp . ci-build:/sources
  • Start the container:

    # Container name: ci-build
    # -a: Attach STDOUT/STDERR and forward signals
    sudo docker start ci-build -a 

Important

Karma configuration

It's necessary ChromeHeadless and --no-sandbox:

// karma.conf.js
...,
browsers: ['ChromeHeadlessNoSandbox'],
customLaunchers: {
    ChromeHeadlessNoSandbox: {
        base: 'ChromeHeadless',
        flags: ['--no-sandbox']
    }
},
...

Protractor configuration

It's necessary:

  • Change the chrome driver location
  • Set --headless, --disable-gpu and --no-sandbox
// protractor.conf.js
...,
chromeDriver: '/usr/bin/chromedriver',
capabilities: {
    browserName: 'chrome',
    chromeOptions: {
        args: [
            '--headless',
            '--disable-gpu',
            '--no-sandbox'
        ]
    }
},
...