I'm running the following simple code:
var Docker = require('dockerode');
var docker = new Docker();
docker.listContainers(console.log);
and getting the following:
eval `docker-machine env` && node index.js
null []
I've got the following one container running:
docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default - virtualbox Running tcp://192.168.99.100:2376 v1.10.3
Am I missing something?
extra info:
➜ test docker-machine --version
docker-machine version 0.6.0, build e27fb87
➜ test docker --version
Docker version 1.10.3, build 20f81dd
This persists after a restart.
I see. Noob mistake. docker-machine manages the virtualbox machines docker uses to run containers on the mac. docker ps is what listContainers is doing and I was getting an empty list because it defaults to {all: false}.
I would think a saner default would be to have listContainers default to what docker ps defaults to, which is to show all - but you've got a backward compat problem now.
Note that this stuff was not apparent to a first time user.
Most helpful comment
I see. Noob mistake. docker-machine manages the virtualbox machines docker uses to run containers on the mac. docker ps is what listContainers is doing and I was getting an empty list because it defaults to {all: false}.
I would think a saner default would be to have listContainers default to what
docker psdefaults to, which is to show all - but you've got a backward compat problem now.Note that this stuff was not apparent to a first time user.