lib/docker.js
function() {
  var split;
  var opts = {};

  if (process.env.DOCKER_HOST) {
    split = /tcp:\/\/([0-9.]+):([0-9]+)/g.exec(process.env.DOCKER_HOST);

    if (process.env.DOCKER_TLS_VERIFY === '1') {
      opts.protocol = 'https';
    }
    else {
      opts.protocol = 'http';
    }

    opts.host = split[1];

    if (process.env.DOCKER_CERT_PATH) {
      opts.ca = fs.readFileSync(path.join(process.env.DOCKER_CERT_PATH, 'ca.pem'));
      opts.cert = fs.readFileSync(path.join(process.env.DOCKER_CERT_PATH, 'cert.pem'));
      opts.key = fs.readFileSync(path.join(process.env.DOCKER_CERT_PATH, 'key.pem'));
    }

    opts.port = split[2];
  }
  else {
    opts.socketPath = '/var/run/docker.sock';
  }

  return new Docker(opts);
}
function() {
  var split;
  var opts = {};

  if (process.env.DOCKER_HOST) {
    split = /tcp:\/\/([0-9.]+):([0-9]+)/g.exec(process.env.DOCKER_HOST);

    if (process.env.DOCKER_TLS_VERIFY === '1') {
      opts.protocol = 'https';
    }
    else {
      opts.protocol = 'http';
    }

    opts.host = split[1];

    if (process.env.DOCKER_CERT_PATH) {
      opts.ca = fs.readFileSync(path.join(process.env.DOCKER_CERT_PATH, 'ca.pem'));
      opts.cert = fs.readFileSync(path.join(process.env.DOCKER_CERT_PATH, 'cert.pem'));
      opts.key = fs.readFileSync(path.join(process.env.DOCKER_CERT_PATH, 'key.pem'));
    }

    opts.port = split[2];
  }
  else {
    opts.socketPath = '/var/run/docker.sock';
  }

  return new Docker(opts);
}
function ( ) { var split ; var opts = { } ; if ( process . env . DOCKER_HOST ) { split = / tcp:\/\/([0-9.]+):([0-9]+) / g . exec ( process . env . DOCKER_HOST ) ; if ( process . env . DOCKER_TLS_VERIFY === '1' ) { opts . protocol = 'https' ; } else { opts . protocol = 'http' ; } opts . host = split [ 1 ] ; if ( process . env . DOCKER_CERT_PATH ) { opts . ca = fs . readFileSync ( path . join ( process . env . DOCKER_CERT_PATH , 'ca.pem' ) ) ; opts . cert = fs . readFileSync ( path . join ( process . env . DOCKER_CERT_PATH , 'cert.pem' ) ) ; opts . key = fs . readFileSync ( path . join ( process . env . DOCKER_CERT_PATH , 'key.pem' ) ) ; } opts . port = split [ 2 ] ; } else { opts . socketPath = '/var/run/docker.sock' ; } return new Docker ( opts ) ; }
instantiates dockerode in one of two forms

new Docker({socketPath: '/var/run/docker.sock'}); - for linux hosts
new Docker({host: 'http://192.168.1.10', port: 3000}); - for mac hosts
instantiates dockerode in one of two forms