Parse docker options out of DOCKER_HOST or Docker in Docker setup

npm install dockerode-options
4 downloads in the last week
5 downloads in the last month


Parse dockerode options from a string for DOCKER_HOST and DIND use cases

Dockerode (and most other clients even in other languages) don't support the same format as DOCKER_HOST so I wrote this to handle the differences.


var dockerOpts = require('dockerode-options');
var Docker = require('dockerode');

var options = dockerOpts(process.env.DOCKER_HOST);
// => { host: '', port: 4243 }

// these can now be used to start dockerode
var docker = new Docker(options);
npm loves you