Browse code

Show active driver in docker info output

Alexander Larsson authored on 2013/11/15 18:24:48
Showing 4 changed files
... ...
@@ -52,6 +52,7 @@ type APIInfo struct {
52 52
 	Debug              bool
53 53
 	Containers         int
54 54
 	Images             int
55
+	Driver             string `json:",omitempty"`
55 56
 	NFd                int    `json:",omitempty"`
56 57
 	NGoroutines        int    `json:",omitempty"`
57 58
 	MemoryLimit        bool   `json:",omitempty"`
... ...
@@ -460,6 +460,7 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
460 460
 
461 461
 	fmt.Fprintf(cli.out, "Containers: %d\n", out.Containers)
462 462
 	fmt.Fprintf(cli.out, "Images: %d\n", out.Images)
463
+	fmt.Fprintf(cli.out, "Driver: %s\n", out.Driver)
463 464
 	if out.Debug || os.Getenv("DEBUG") != "" {
464 465
 		fmt.Fprintf(cli.out, "Debug mode (server): %v\n", out.Debug)
465 466
 		fmt.Fprintf(cli.out, "Debug mode (client): %v\n", os.Getenv("DEBUG") != "")
... ...
@@ -11,6 +11,8 @@ import (
11 11
 type InitFunc func(root string) (Driver, error)
12 12
 
13 13
 type Driver interface {
14
+	String() string
15
+
14 16
 	Create(id, parent string) error
15 17
 	Remove(id string) error
16 18
 
... ...
@@ -375,6 +375,7 @@ func (srv *Server) DockerInfo() *APIInfo {
375 375
 	return &APIInfo{
376 376
 		Containers:         len(srv.runtime.List()),
377 377
 		Images:             imgcount,
378
+		Driver:             srv.runtime.driver.String(),
378 379
 		MemoryLimit:        srv.runtime.capabilities.MemoryLimit,
379 380
 		SwapLimit:          srv.runtime.capabilities.SwapLimit,
380 381
 		IPv4Forwarding:     !srv.runtime.capabilities.IPv4ForwardingDisabled,