joyent-portal/legacy/docker-graphql/src/api/client.js
Sérgio Ramos 8295bd6882 chore: initial lerna setup
this shall be a progressive process
2017-05-25 10:56:50 +01:00

17 lines
489 B
JavaScript

const Docker = require('dockerode');
const url = require('url');
const path = require('path');
const fs = require('fs');
const config = require('../config');
const location = url.parse(config.host);
module.exports = new Docker({
host: location.hostname,
port: Number(location.port),
ca: fs.readFileSync(path.join(config.cert, 'ca.pem')),
cert: fs.readFileSync(path.join(config.cert, 'cert.pem')),
key: fs.readFileSync(path.join(config.cert, 'key.pem')),
version: 'v1.24'
});