Comparing version 2.5.8 to 3.0.0
@@ -53,3 +53,3 @@ var util = require('./util'); | ||
* | ||
* @param {object} options | ||
* @param {object} opts | ||
* @param {function} callback | ||
@@ -81,4 +81,3 @@ */ | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -85,0 +84,0 @@ }); |
@@ -43,3 +43,3 @@ var extend = require('./util').extend, | ||
* Inspect | ||
* @param {Options} opts Options (optional) | ||
* @param {Object} opts Options (optional) | ||
* @param {Function} callback Callback, if supplied will query Docker. | ||
@@ -106,4 +106,3 @@ * @return {Object} ID only and only if callback isn't supplied. | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -146,4 +145,3 @@ }); | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -160,3 +158,3 @@ }); | ||
* Top | ||
* @param {Object} Options like 'ps_args' (optional) | ||
* @param {Object} opts like 'ps_args' (optional) | ||
* @param {Function} callback Callback | ||
@@ -291,4 +289,3 @@ */ | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -331,4 +328,3 @@ }); | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -405,4 +401,3 @@ }); | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -443,4 +438,3 @@ }); | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -482,4 +476,3 @@ }); | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -601,4 +594,3 @@ }); | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -640,4 +632,3 @@ }); | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -679,4 +670,3 @@ }); | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -718,4 +708,3 @@ }); | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -722,0 +711,0 @@ }); |
@@ -304,3 +304,22 @@ var EventEmitter = require('events').EventEmitter, | ||
}); | ||
return build(pack.pipe(zlib.createGzip())); | ||
if (callback === undefined) { | ||
return new self.modem.Promise(function(resolve, reject) { | ||
pack.on('error', function(error) { | ||
return reject(error); | ||
}); | ||
pack.on('end', function() { | ||
return resolve(build(stream)); | ||
}); | ||
var stream = pack.pipe(zlib.createGzip()); | ||
}); | ||
} else { | ||
pack.on('error', function(error) { | ||
return callback(error); | ||
}); | ||
pack.on('end', function() { | ||
return build(stream); | ||
}); | ||
var stream = pack.pipe(zlib.createGzip()); | ||
} | ||
} else { | ||
@@ -401,3 +420,3 @@ return build(file); | ||
* Lists containers | ||
* @param {Options} opts Options (optional) | ||
* @param {Object} opts Options (optional) | ||
* @param {Function} callback Callback | ||
@@ -438,3 +457,3 @@ */ | ||
* Lists images | ||
* @param {Options} opts Options (optional) | ||
* @param {Object} opts Options (optional) | ||
* @param {Function} callback Callback | ||
@@ -475,2 +494,3 @@ */ | ||
* Lists Services | ||
* @param {Object} opts | ||
* @param {Function} callback Callback | ||
@@ -510,2 +530,3 @@ */ | ||
* Lists Nodes | ||
* @param {Object} opts | ||
* @param {Function} callback Callback | ||
@@ -548,2 +569,3 @@ */ | ||
* Lists Tasks | ||
* @param {Object} opts | ||
* @param {Function} callback Callback | ||
@@ -663,2 +685,3 @@ */ | ||
* Lists secrets | ||
* @param {Object} opts | ||
* @param {Function} callback Callback | ||
@@ -698,2 +721,3 @@ */ | ||
* Lists configs | ||
* @param {Object} opts | ||
* @param {Function} callback Callback | ||
@@ -771,2 +795,3 @@ */ | ||
* Lists plugins | ||
* @param {Object} opts | ||
* @param {Function} callback Callback | ||
@@ -806,3 +831,3 @@ */ | ||
* Prune images | ||
* @param {Options} opts Options (optional) | ||
* @param {Object} opts Options (optional) | ||
* @param {Function} callback Callback | ||
@@ -874,3 +899,3 @@ */ | ||
* Prune containers | ||
* @param {Options} opts Options (optional) | ||
* @param {Object} opts Options (optional) | ||
* @param {Function} callback Callback | ||
@@ -910,3 +935,3 @@ */ | ||
* Prune volumes | ||
* @param {Options} opts Options (optional) | ||
* @param {Object} opts Options (optional) | ||
* @param {Function} callback Callback | ||
@@ -946,3 +971,3 @@ */ | ||
* Prune networks | ||
* @param {Options} opts Options (optional) | ||
* @param {Object} opts Options (optional) | ||
* @param {Function} callback Callback | ||
@@ -1020,2 +1045,3 @@ */ | ||
* Creates a new service | ||
* @param {Object} auth | ||
* @param {Object} opts Create options | ||
@@ -1067,3 +1093,3 @@ * @param {Function} callback Callback | ||
* Lists volumes | ||
* @param {Options} opts Options (optional) | ||
* @param {Object} opts Options (optional) | ||
* @param {Function} callback Callback | ||
@@ -1142,3 +1168,3 @@ */ | ||
* Lists networkss | ||
* @param {Options} opts Options (optional) | ||
* @param {Object} opts Options (optional) | ||
* @param {Function} callback Callback | ||
@@ -1386,3 +1412,3 @@ */ | ||
args.opts.fromImage = imageSrc.repository; | ||
args.opts.tag = imageSrc.tag; | ||
args.opts.tag = imageSrc.tag || 'latest'; | ||
@@ -1549,7 +1575,6 @@ var argsf = [args.opts, args.callback]; | ||
return containero.start(startOptions); | ||
}).then(function(container) { | ||
return container.wait(); | ||
}).then(function(data) { | ||
containero.output = data; | ||
resolve(containero); | ||
return containero.wait(); | ||
}).then(function(data) { | ||
resolve([data, containero]); | ||
}).catch(function(err) { | ||
@@ -1564,3 +1589,3 @@ reject(err); | ||
* | ||
* @param {object} options | ||
* @param {object} opts | ||
* @param {function} callback | ||
@@ -1602,3 +1627,3 @@ */ | ||
* | ||
* @param {object} options | ||
* @param {object} opts | ||
* @param {function} callback | ||
@@ -1640,2 +1665,3 @@ */ | ||
* | ||
* @param {object} opts | ||
* @param {function} callback | ||
@@ -1676,2 +1702,3 @@ */ | ||
* | ||
* @param {object} opts | ||
* @param {function} callback | ||
@@ -1678,0 +1705,0 @@ */ |
@@ -18,3 +18,3 @@ var util = require('./util'); | ||
* | ||
* @param {object} options | ||
* @param {object} opts | ||
* @param {function} callback | ||
@@ -50,4 +50,3 @@ */ | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -66,3 +65,3 @@ }); | ||
* | ||
* @param {object} options | ||
* @param {object} opts | ||
* @param {function} callback | ||
@@ -91,4 +90,3 @@ */ | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -95,0 +93,0 @@ }); |
@@ -52,2 +52,3 @@ var util = require('./util'); | ||
* Distribution | ||
* @param {Object} opts | ||
* @param {Function} callback Callback, if specified Docker will be queried. | ||
@@ -225,4 +226,3 @@ * @return {Object} Name only if callback isn't specified. | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -229,0 +229,0 @@ }); |
@@ -116,4 +116,3 @@ var util = require('./util'); | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -156,4 +155,3 @@ }); | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -160,0 +158,0 @@ }); |
@@ -18,3 +18,2 @@ var util = require('./util'); | ||
* | ||
* @param {object} options | ||
* @param {function} callback | ||
@@ -55,3 +54,3 @@ */ | ||
* | ||
* @param {object} options | ||
* @param {object} opts | ||
* @param {function} callback | ||
@@ -83,4 +82,3 @@ */ | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -100,3 +98,3 @@ }); | ||
* | ||
* @param {object} options | ||
* @param {object} opts | ||
* @param {function} callback | ||
@@ -103,0 +101,0 @@ */ |
@@ -193,4 +193,3 @@ var util = require('./util'); | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -230,4 +229,3 @@ }); | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -304,4 +302,3 @@ }); | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -320,3 +317,4 @@ }); | ||
* | ||
* @param {object} options | ||
* @param {object} auth | ||
* @param {object} opts | ||
* @param {function} callback | ||
@@ -351,4 +349,3 @@ */ | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -355,0 +352,0 @@ }); |
@@ -53,3 +53,3 @@ var util = require('./util'); | ||
* | ||
* @param {object} options | ||
* @param {object} opts | ||
* @param {function} callback | ||
@@ -80,4 +80,3 @@ */ | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -84,0 +83,0 @@ }); |
@@ -87,3 +87,4 @@ var util = require('./util'); | ||
* | ||
* @param {object} options | ||
* @param {object} auth | ||
* @param {object} opts | ||
* @param {function} callback | ||
@@ -123,4 +124,3 @@ */ | ||
} | ||
self.output = data; | ||
resolve(self); | ||
resolve(data); | ||
}); | ||
@@ -127,0 +127,0 @@ }); |
@@ -22,3 +22,2 @@ var util = require('./util'); | ||
* | ||
* @param {object} options | ||
* @param {function} callback | ||
@@ -25,0 +24,0 @@ */ |
{ | ||
"name": "dockerode", | ||
"description": "Docker Remote API module.", | ||
"version": "2.5.8", | ||
"version": "3.0.0", | ||
"author": "Pedro Dias <petermdias@gmail.com>", | ||
@@ -18,8 +18,8 @@ "maintainers": [ | ||
"dependencies": { | ||
"concat-stream": "~1.6.2", | ||
"docker-modem": "^1.0.8", | ||
"tar-fs": "~1.16.3" | ||
"concat-stream": "~2.0.0", | ||
"docker-modem": "^1.0.9", | ||
"tar-fs": "~2.0.0" | ||
}, | ||
"devDependencies": { | ||
"bluebird": "^3.5.3", | ||
"bluebird": "^3.5.5", | ||
"chai": "~4.1.0", | ||
@@ -26,0 +26,0 @@ "memorystream": "~0.3.0", |
@@ -85,2 +85,3 @@ # dockerode [![Build Status](https://travis-ci.org/apocas/dockerode.svg?branch=master)](https://travis-ci.org/apocas/dockerode) | ||
// promises are supported | ||
var auxContainer; | ||
docker.createContainer({ | ||
@@ -96,13 +97,14 @@ Image: 'ubuntu', | ||
}).then(function(container) { | ||
return container.start(); | ||
}).then(function(container) { | ||
return container.resize({ | ||
auxContainer = container; | ||
return auxContainer.start(); | ||
}).then(function(data) { | ||
return auxContainer.resize({ | ||
h: process.stdout.rows, | ||
w: process.stdout.columns | ||
}); | ||
}).then(function(container) { | ||
return container.stop(); | ||
}).then(function(container) { | ||
return container.remove(); | ||
}).then(function(data) { | ||
return auxContainer.stop(); | ||
}).then(function(data) { | ||
return auxContainer.remove(); | ||
}).then(function(data) { | ||
console.log('container removed'); | ||
@@ -181,3 +183,3 @@ }).catch(function(err) { | ||
/* ... */ | ||
} | ||
}); | ||
@@ -195,3 +197,3 @@ //tty:false | ||
/* ... */ | ||
} | ||
}); | ||
@@ -216,7 +218,7 @@ docker.createImage({fromImage: 'ubuntu'}, function (err, stream) { | ||
// close the write-side of the stream without also closing the read-side! | ||
fs.createReadStream('node-v5.1.0.tgz', 'binary').pipe(stream.output); | ||
fs.createReadStream('node-v5.1.0.tgz', 'binary').pipe(stream); | ||
// Fortunately, we have a regular TCP socket now, so when the readstream finishes and closes our | ||
// stream, it is still open for reading and we will still get our results :-) | ||
docker.modem.demuxStream(stream.output, process.stdout, process.stderr); | ||
docker.modem.demuxStream(stream, process.stdout, process.stderr); | ||
}); | ||
@@ -244,4 +246,6 @@ }); | ||
//promise | ||
docker.run(testImage, ['bash', '-c', 'uname -a'], process.stdout).then(function(container) { | ||
console.log(container.output.StatusCode); | ||
docker.run(testImage, ['bash', '-c', 'uname -a'], process.stdout).then(function(data) { | ||
var output = data[0]; | ||
var container = data[1]; | ||
console.log(output.StatusCode); | ||
return container.remove(); | ||
@@ -440,3 +444,3 @@ }).then(function(data) { | ||
- image.history() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageHistory) | ||
- image.push(options, callback, auth) { - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImagePush) | ||
- image.push(options, callback, auth) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImagePush) | ||
- image.tag(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageTag) | ||
@@ -443,0 +447,0 @@ - image.remove(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageDelete) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4124
510
143174
19
+ Addedbase64-js@1.5.1(transitive)
+ Addedbl@4.1.0(transitive)
+ Addedbuffer@5.7.1(transitive)
+ Addedconcat-stream@2.0.0(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedmkdirp-classic@0.5.3(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedtar-fs@2.0.1(transitive)
+ Addedtar-stream@2.2.0(transitive)
- Removedbl@1.2.3(transitive)
- Removedbuffer-alloc@1.2.0(transitive)
- Removedbuffer-alloc-unsafe@1.1.0(transitive)
- Removedbuffer-fill@1.0.0(transitive)
- Removedconcat-stream@1.6.2(transitive)
- Removedisarray@1.0.0(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedpump@1.0.3(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedtar-fs@1.16.3(transitive)
- Removedtar-stream@1.6.2(transitive)
- Removedto-buffer@1.1.1(transitive)
- Removedxtend@4.0.2(transitive)
Updatedconcat-stream@~2.0.0
Updateddocker-modem@^1.0.9
Updatedtar-fs@~2.0.0