Skip to content

Commit

Permalink
add: new method pullAll
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasHeine committed Feb 9, 2024
1 parent 54b3fb4 commit 461c4b7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1465,6 +1465,27 @@ Docker.prototype.pull = function(repoTag, opts, callback, auth) {
return this.createImage.apply(this, argsf);
};

/**
* PullAll is a wrapper around createImage, to pull all image tags of an image.
* @param {String} repoTag Repository tag
* @param {Object} opts Options (optional)
* @param {Function} callback Callback
* @param {Object} auth Authentication (optional)
* @return {Object} Image
*/
Docker.prototype.pullAll = function(repoTag, opts, callback, auth) {
var args = util.processArgs(opts, callback);

var imageSrc = util.parseRepositoryTag(repoTag);
args.opts.fromImage = imageSrc.repository;

var argsf = [args.opts, args.callback];
if (auth) {
argsf = [auth, args.opts, args.callback];
}
return this.createImage.apply(this, argsf);
};

/**
* Like run command from Docker's CLI
* @param {String} image Image name to be used.
Expand Down

0 comments on commit 461c4b7

Please sign in to comment.