Skip to content

Commit

Permalink
getImages added to docker
Browse files Browse the repository at this point in the history
  • Loading branch information
danlester committed Nov 29, 2019
1 parent 077a9b5 commit f87e8cd
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions lib/docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,43 @@ Docker.prototype.listImages = function(opts, callback) {
}
};

/**
* Get images
* @param {Object} opts Options (optional)
* @param {Function} callback Callback
*/
Docker.prototype.getImages = function(opts, callback) {
var self = this;
var args = util.processArgs(opts, callback);

var optsf = {
path: '/images/get?',
method: 'GET',
options: args.opts,
isStream: true,
statusCodes: {
200: true,
400: 'bad parameter',
500: 'server error'
}
};

if (args.callback === undefined) {
return new this.modem.Promise(function(resolve, reject) {
self.modem.dial(optsf, function(err, data) {
if (err) {
return reject(err);
}
resolve(data);
});
});
} else {
this.modem.dial(optsf, function(err, data) {
args.callback(err, data);
});
}
};

/**
* Lists Services
* @param {Object} opts
Expand Down

0 comments on commit f87e8cd

Please sign in to comment.