dkr
v0.0.2
Published
A library to provide Docker command line API for Node.js
Downloads
3
Readme
dkr
dkr is a library to provide Docker command line API for Node.js
Dependencies
This library depends on docker command line tool.
You need to install docker on your machine to use the library.
Installation
npm install -S dkr
Usage
ps
var dkr = require('dkr');
dkr.ps()
.then(function(containers) {
console.log(containers);
})
.catch(function(e) {
console.error(e);
});
run
var dkr = require('dkr');
dkr.run('node:5.7.0', {
detach: true,
port: '8888:8888',
name: 'my-node',
command: '',
args: [
]
})
.then(function(containerId) {
console.log(containerId);
})
.catch(function(e) {
console.error(e);
});
rm
var dkr = require('dkr');
dkr.rm(containerId, {
force: true
})
then(function(containerId) {
console.log(containerId);
})
.catch(function(e) {
console.error(e);
});