Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dockerode

Package Overview
Dependencies
Maintainers
1
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dockerode - npm Package Compare versions

Comparing version 2.2.7 to 2.2.8

33

lib/container.js

@@ -39,10 +39,14 @@ var extend = require('./util').extend,

* Inspect
* @param {Options} opts Options (optional)
* @param {Function} callback Callback, if supplied will query Docker.
* @return {Object} ID only and only if callback isn't supplied.
*/
Container.prototype.inspect = function(callback) {
if (typeof callback === 'function') {
Container.prototype.inspect = function(opts, callback) {
var args = util.processArgs(opts, callback);
if (typeof args.callback === 'function') {
var optsf = {
path: '/containers/' + this.id + '/json',
path: '/containers/' + this.id + '/json?',
method: 'GET',
options: args.opts,
statusCodes: {

@@ -56,3 +60,3 @@ 200: true,

this.modem.dial(optsf, function(err, data) {
callback(err, data);
args.callback(err, data);
});

@@ -67,6 +71,6 @@ } else {

/**
* Rename
* @param {Object} opts Rename options
* @param {Function} callback Callback
*/
* Rename
* @param {Object} opts Rename options
* @param {Function} callback Callback
*/
Container.prototype.rename = function(opts, callback) {

@@ -255,3 +259,3 @@ var args = util.processArgs(opts, callback, this.defaultOptions.rename);

this.modem.dial(optsf, function(err, data) {
if(err) return args.callback(err, data);
if (err) return args.callback(err, data);
args.callback(err, new Exec(self.modem, data.Id));

@@ -469,3 +473,3 @@ });

Container.prototype.copy = function(opts, callback) {
console.log('container.copy is depreacted since Docker v1.8.x');
console.log('container.copy is deprecated since Docker v1.8.x');
var args = util.processArgs(opts, callback, this.defaultOptions.copy);

@@ -570,3 +574,2 @@

/**

@@ -598,6 +601,6 @@ * Container logs

/**
* Container stats
* @param {Object} opts Stats options. (optional)
* @param {Function} callback Callback with data
*/
* Container stats
* @param {Object} opts Stats options. (optional)
* @param {Function} callback Callback with data
*/
Container.prototype.stats = function(opts, callback) {

@@ -604,0 +607,0 @@ var args = util.processArgs(opts, callback, this.defaultOptions.stats);

@@ -37,3 +37,3 @@ var EventEmitter = require('events').EventEmitter,

this.modem.dial(optsf, function(err, data) {
if(err) return callback(err, data);
if (err) return callback(err, data);
callback(err, self.getContainer(data.Id));

@@ -151,11 +151,13 @@ });

if(opts.registryconfig) {
optsf.registryconfig = optsf.options.registryconfig;
delete optsf.options.registryconfig;
}
if (opts) {
if (opts.registryconfig) {
optsf.registryconfig = optsf.options.registryconfig;
delete optsf.options.registryconfig;
}
//undocumented?
if(opts.authconfig) {
optsf.authconfig = optsf.options.authconfig;
delete optsf.options.authconfig;
//undocumented?
if (opts.authconfig) {
optsf.authconfig = optsf.options.authconfig;
delete optsf.options.authconfig;
}
}

@@ -200,3 +202,2 @@

/**

@@ -264,19 +265,19 @@ * Fetches an Exec instance by ID

Docker.prototype.createVolume = function(opts, callback) {
var args = util.processArgs(opts, callback);
var self = this;
var optsf = {
path: '/volumes/create?',
method: 'POST',
options: args.opts,
statusCodes: {
200: true, // unofficial, but proxies may return it
201: true,
500: 'server error'
}
};
var args = util.processArgs(opts, callback);
var self = this;
var optsf = {
path: '/volumes/create?',
method: 'POST',
options: args.opts,
statusCodes: {
200: true, // unofficial, but proxies may return it
201: true,
500: 'server error'
}
};
this.modem.dial(optsf, function(err, data) {
if(err) return args.callback(err, data);
args.callback(err, self.getVolume(data.Name));
});
this.modem.dial(optsf, function(err, data) {
if (err) return args.callback(err, data);
args.callback(err, self.getVolume(data.Name));
});
};

@@ -314,20 +315,20 @@

Docker.prototype.createNetwork = function(opts, callback) {
var args = util.processArgs(opts, callback);
var self = this;
var optsf = {
path: '/networks/create?',
method: 'POST',
options: args.opts,
statusCodes: {
200: true, // unofficial, but proxies may return it
201: true,
404: 'driver not found',
500: 'server error'
}
};
var args = util.processArgs(opts, callback);
var self = this;
var optsf = {
path: '/networks/create?',
method: 'POST',
options: args.opts,
statusCodes: {
200: true, // unofficial, but proxies may return it
201: true,
404: 'driver not found',
500: 'server error'
}
};
this.modem.dial(optsf, function(err, data) {
if(err) return args.callback(err, data);
args.callback(err, self.getNetwork(data.Id));
});
this.modem.dial(optsf, function(err, data) {
if (err) return args.callback(err, data);
args.callback(err, self.getNetwork(data.Id));
});
};

@@ -359,3 +360,2 @@

/**

@@ -485,3 +485,3 @@ * Search images

var argsf = [args.opts, args.callback];
if(auth) {
if (auth) {
argsf = [auth, args.opts, args.callback];

@@ -519,3 +519,7 @@ }

container.attach({stream: true, stdout: true, stderr: true}, function handler(err, stream) {
container.attach({
stream: true,
stdout: true,
stderr: true
}, function handler(err, stream) {
if (err) return callback(err, null, container);

@@ -527,5 +531,9 @@

if (streamo instanceof Array) {
stream.on('end', function () {
try { streamo[0].end(); } catch (e) {}
try { streamo[1].end(); } catch (e) {}
stream.on('end', function() {
try {
streamo[0].end();
} catch (e) {}
try {
streamo[1].end();
} catch (e) {}
});

@@ -535,3 +543,5 @@ container.modem.demuxStream(stream, streamo[0], streamo[1]);

stream.setEncoding('utf8');
stream.pipe(streamo, {end: true});
stream.pipe(streamo, {
end: true
});
}

@@ -541,3 +551,3 @@ }

container.start(startOptions, function(err, data) {
if(err) return callback(err, data, container);
if (err) return callback(err, data, container);

@@ -544,0 +554,0 @@ container.wait(function(err, data) {

@@ -0,0 +0,0 @@ var util = require('./util');

@@ -0,0 +0,0 @@ var util = require('./util');

@@ -0,0 +0,0 @@ var util = require('./util');

@@ -0,0 +0,0 @@ var util = require('./util');

{
"name": "dockerode",
"description": "Docker Remote API module.",
"version": "2.2.7",
"version": "2.2.8",
"author": "Pedro Dias <petermdias@gmail.com>",

@@ -18,3 +18,3 @@ "maintainers": [

"dependencies": {
"docker-modem": "0.2.x"
"docker-modem": "0.3.x"
},

@@ -21,0 +21,0 @@ "devDependencies": {

@@ -0,0 +0,0 @@ # dockerode

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc