https://github.com/simbo/docker-node-chrome
Docker image with node and headless chrome (i.e. for testing with karma or protractor).
https://github.com/simbo/docker-node-chrome
Last synced: 3 months ago
JSON representation
Docker image with node and headless chrome (i.e. for testing with karma or protractor).
- Host: GitHub
- URL: https://github.com/simbo/docker-node-chrome
- Owner: simbo
- License: mit
- Created: 2017-07-14T00:17:22.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-25T17:40:40.000Z (almost 9 years ago)
- Last Synced: 2025-01-21T09:09:23.705Z (over 1 year ago)
- Homepage: https://hub.docker.com/r/simbo/node-chrome/
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
docker-node-chrome
==================
> Docker image with node and headless chrome (i.e. for testing with karma or protractor).
[](https://hub.docker.com/r/simbo/node-chrome/)
Derivate of [simbo/node](https://hub.docker.com/r/simbo/node/).
``` sh
docker pull simbo/node-chrome:latest
```
## Version tags
- `latest` / `8-59` / `8.1.4-59.0.3071.115`
Node 8.1.4
Google Chrome 59.0.3071.115
## Usage
### Docker
Use these flags with `docker run` or add them to your service in `docker-compose.yml`:
- `--add-cap=SYS_ADMIN`
This fixes a user namespace issue with OSX.
An alternative mitigation would be to a [special seccomp profile](https://twitter.com/jessfraz/status/681934414687801345).
- `--shm-size=1024M`
Chrome needs some more shared memory than docker’s default of 64 MB.
Alternatively you can mount `/dev/shm` from your host machine.
### Karma
`karma.conf.js` with [karma-chrome-launcher](https://www.npmjs.com/package/karma-chrome-launcher) installed:
``` js
module.exports = (config) => {
config.set({
mime: {
'text/x-typescript': ['ts','tsx']
},
browsers: [
'Chrome_launcher'
],
customLaunchers: {
Chrome_launcher: {
base: 'ChromeHeadless',
flags: [
'--window-size=1280x1024'
],
}
}
});
};
```
### Protractor
Run `webdriver-manager update` to install chromedriver.
`protractor.conf.js`:
``` js
module.exports.config = {
directConnect: true,
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: [
'--headless',
'--disable-gpu',
'--window-size=1280x1024'
]
}
}
};
```