Files
docker-machine/docs/reference/ls.md
Anil Belur 3d56a87539 Update docs with examples for dm ls --filter.
This is a follow-up for PR #2310.

Signed-off-by: Anil Belur <askb23@gmail.com>
2015-12-08 21:12:00 +05:30

1.7 KiB

ls

Usage: docker-machine ls [OPTIONS] [arg...]

List machines

Options:

   --quiet, -q					Enable quiet mode
   --filter [--filter option --filter option]	Filter output based on conditions provided

Filtering

The filtering flag (-f or --filter) format is a key=value pair. If there is more than one filter, then pass multiple flags (e.g. --filter "foo=bar" --filter "bif=baz")

The currently supported filters are:

  • driver (driver name)
  • swarm (swarm master's name)
  • state (Running|Paused|Saved|Stopped|Stopping|Starting|Error)
  • name (Machine name returned by driver, supports golang style regular expressions)
  • label (Machine created with --engine-label option, can be filtered with label=<key>[=<value>])

Examples

$ docker-machine ls
NAME   ACTIVE   DRIVER       STATE     URL
dev    -        virtualbox   Stopped
foo0   -        virtualbox   Running   tcp://192.168.99.105:2376
foo1   -        virtualbox   Running   tcp://192.168.99.106:2376
foo2   *        virtualbox   Running   tcp://192.168.99.107:2376

$ docker-machine ls --filter driver=virtualbox --filter state=Stopped
NAME   ACTIVE   DRIVER       STATE     URL   SWARM
dev    -        virtualbox   Stopped

$ docker-machine ls --filter label=com.class.app=foo1 --filter label=com.class.app=foo2
NAME   ACTIVE   DRIVER       STATE     URL
foo1   -        virtualbox   Running   tcp://192.168.99.105:2376
foo2   *        virtualbox   Running   tcp://192.168.99.107:2376