Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

azuki-trusty / azk   deb

Repository URL to install this package:

Version: 0.5.1 

/ usr / lib / azk / node_modules / dockerode / examples / listContainers.js

var Docker = require('../lib/docker');
var fs     = require('fs');

var socket = process.env.DOCKER_SOCKET || '/var/run/docker.sock';
var stats  = fs.statSync(socket);

if (!stats.isSocket()) {
  throw new Error("Are you sure the docker is running?");
}

var docker = new Docker({ socketPath: socket });

docker.listContainers({all: true}, function(err, containers) {
  console.log('ALL: ' + containers.length);
});

docker.listContainers({all: false}, function(err, containers) {
  console.log('!ALL: ' + containers.length);
});