1.0.1 • Published 9 years ago
docker-init v1.0.1
Docker Init

Init docker with dockerode parameters.
Install
npm i docker-init --saveHow to use?
docker init takes options with 3 properties:
- socketPath -
/var/run/docker.sockby default - host - host of docker machine, could be used
$DOCKER_HOSTor any host in format<ip>:<port>, e.g.192.168.99.100:2376. - certPath - path to read certificates (
key.pem,ca.pem,cert.pem) from, could be used$DOCKER_CERT_PATH.
let dockerInit = require('docker-init');
// on local linux
docker = dockerInit();
// on mac os or windows, with default docker install
docker = dockerInit({
host : process.env.DOCKER_HOST,
certPath : process.env.DOCKER_CERT_PATH
});
// now you can use Dockerode APILicense
MIT