# Installation
Docker
You need to have Docker installed. Download the native version of Docker for your platform here
If you have Docker Toolbox installed then it is best to uninstall it before install Docker native.
Module
To install the module
$ npm i mns-core-docker
Usage
Docker compose
DockerCompose take 3 parameters:
|Param|Description| Required | |-----|----|----| |{string} filePath | The path to the docker compose file | Yes | |{string} projectName | The name of the compose project | No | |{string} host | The host docker machine | No |
var DockerCompose = require('mns-core-docker').dockerCompose;
var compose = new DockerCompose(path.join(__dirname, './selenium/selenium-grid.yml'));
compose.scale('chrome=3', 'firefox=3')
.then(function() {
return compose.up();
})
.then(function() {
return compose.stop();
})
.then(function() {
return compose.rm();
});
See Docker Compose CLI for reference. Not all commands have been implemented.
VNC
VNC will open a vnc window into the docker container if the container supports this feature.
|Param|Default|Required| |------|-----|-----| |protocol|vnc://'| No | |username|'secret'| No | |password|'secret'| No | |host|local IP| No | |port|5900| No |
var vnc = require('mns-core-docker').vnc;
vnc.open();
// or
vnc.open({port: '5901'});
Further reading
Changelog
2.0.1
- Fix VNC to wait for connection
2.0.0
- Added docker compose. Runs native Docker.
- Deprecated virtualbox (Docker Toolbox)
1.0.0
- first working npm publish
Contributing
Here's the most direct way to get your work merged into the project:
- Fork the project.
- Clone down your fork (
git clone git@github.com:[username]/mns-core-docker.git
). - Create a topic branch to contain your change (
git checkout -b my_awesome_feature
). - Hack away, add tests. Not necessarily in that order.
- Make sure everything still passes by running
npm run test
. - If necessary, rebase your commits into logical chunks, without errors.
- Push the branch up (
git push origin my_awesome_feature
). - Create a pull request against mns-core-aut/develop and describe what your change does and the why you think it should be merged.