Skip to content

Commit

Permalink
Merge branch 'master' of github.com:apocas/dockerode
Browse files Browse the repository at this point in the history
  • Loading branch information
apocas committed Jun 18, 2024
2 parents 76f4bda + 0a1e34c commit 23d9e63
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 15 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ Amazing entities that [sponsor](https://github.com/sponsors/apocas) my open-sour
- docker.swarmUpdate(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SwarmUpdate)
- docker.swarmInspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SwarmInspect)
- docker.pull(repoTag, options, callback, auth) - Like Docker's CLI pull
- docker.pullAll(repoTag, options, callback, auth) - Like Docker's CLI pull with "-a"
- docker.run(image, cmd, stream, createOptions, startOptions) - Like Docker's CLI run


Expand Down
3 changes: 3 additions & 0 deletions examples/run_stdin.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ var previousKey,
CTRL_Q = '\u0011';

function handler(err, container) {
//Check error and thow it
if(err) throw new Error(err);

var attach_opts = {stream: true, stdin: true, stdout: true, stderr: true};

container.attach(attach_opts, function handler(err, stream) {
Expand Down
2 changes: 1 addition & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Config.prototype.remove = function(opts, callback) {
var optsf = {
path: '/configs/' + this.id,
method: 'DELETE',
abortSignal: opts.abortSignal,
abortSignal: args.opts.abortSignal,
statusCodes: {
200: true,
204: true,
Expand Down
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
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dockerode",
"description": "Docker Remote API module.",
"version": "4.0.0",
"version": "4.0.2",
"author": "Pedro Dias <[email protected]>",
"maintainers": [
"apocas <[email protected]>"
Expand All @@ -16,7 +16,7 @@
],
"dependencies": {
"@balena/dockerignore": "^1.0.2",
"docker-modem": "^5.0.0",
"docker-modem": "^5.0.3",
"tar-fs": "~2.0.1"
},
"devDependencies": {
Expand Down

0 comments on commit 23d9e63

Please sign in to comment.