1.0.1 • Published 8 years ago

docker-init v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

Docker Init License NPM version Dependency Status Build Status Coverage Status

Init docker with dockerode parameters.

Install

npm i docker-init --save

How to use?

docker init takes options with 3 properties:

  • socketPath - /var/run/docker.sock by default
  • host - host of docker machine, could be used $DOCKER_HOST or 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 API

License

MIT