dockerode-options
Can both parse string based options (like 127.0.0.1:4243) for dockerode and find sensible defaults for connecting to docker.
Usage
With a string
var dockerOpts = ;var Docker = ; // DOCKER_HOST = '127.0.0.1:4243'var options = ;// => { host: 'http://127.0.0.1', port: 4243 } // these can now be used to start dockerodevar docker = options;
With no options
var dockerOpts = ;var options = ;// => { socketPath: '/var/run/docker.sock' }
With DOCKER_HOST environment variable set
var dockerOpts = ; processenvDOCKER_HOST = '127.0.0.1:60022'; var options = ;// => { host: '127.0.0.1', port: 60022 };
With DOCKER_CERT_PATH environment variable set
var dockerOpts = ; processenvDOCKER_CERT_PATH = '/home/certs'; var options = ;// => { ca: <contents of /home/certs/ca.pem>, cert: <contents of /home/certs/cert.pem>, key: <contents of /home/certs/key.pem> };