docker-init
v1.0.1
Published
init docker with parameters
Downloads
5
Readme
Docker Init
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