Compare commits

...

4 Commits

Author SHA1 Message Date
65c37bdd6f 1.0.49 2019-08-16 21:21:31 +02:00
6acbe30e2e fix(core): update 2019-08-16 21:21:30 +02:00
eb6f7889d0 1.0.48 2019-08-16 21:10:03 +02:00
e39da5fee9 fix(core): update 2019-08-16 21:10:03 +02:00
4 changed files with 13 additions and 5 deletions

View File

@ -48,7 +48,7 @@ testLTS:
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
- priv
testBuild:
stage: test

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@mojoio/docker",
"version": "1.0.47",
"version": "1.0.49",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@mojoio/docker",
"version": "1.0.47",
"version": "1.0.49",
"description": "easy communication with docker remote api from node, TypeScript ready",
"private": false,
"main": "dist/index.js",

View File

@ -12,8 +12,16 @@ export class DockerHost {
* the constructor to instantiate a new docker sock instance
* @param pathArg
*/
constructor(pathArg: string = 'http://unix:/var/run/docker.sock:') {
this.socketPath = pathArg;
constructor(pathArg?: string) {
let pathToUse: string;
if (pathArg) {
pathToUse = pathArg;
} else if (process.env.CI) {
pathToUse = 'tcp://docker:2375/';
} else {
pathToUse = 'http://unix:/var/run/docker.sock:';
}
this.socketPath = pathToUse;
}
/**