Browse code

Return docker's root dir in docker -D info

This adds the docker daemon's root directory to docker info when running
in debug mode. This allows the user to view the root directory where
docker is writing and storing state.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Michael Crosby authored on 2014/12/04 08:29:54
Showing 3 changed files
... ...
@@ -544,6 +544,9 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
544 544
 		if initPath := remoteInfo.Get("InitPath"); initPath != "" {
545 545
 			fmt.Fprintf(cli.out, "Init Path: %s\n", initPath)
546 546
 		}
547
+		if root := remoteInfo.Get("DockerRootDir"); root != "" {
548
+			fmt.Fprintf(cli.out, "Docker Root Dir: %s\n", root)
549
+		}
547 550
 	}
548 551
 
549 552
 	if len(remoteInfo.GetList("IndexServerAddress")) != 0 {
... ...
@@ -76,6 +76,7 @@ func (daemon *Daemon) CmdInfo(job *engine.Job) engine.Status {
76 76
 	v.Set("InitPath", initPath)
77 77
 	v.SetInt("NCPU", runtime.NumCPU())
78 78
 	v.SetInt64("MemTotal", meminfo.MemTotal)
79
+	v.Set("DockerRootDir", daemon.Config().Root)
79 80
 	if hostname, err := os.Hostname(); err == nil {
80 81
 		v.Set("Name", hostname)
81 82
 	}
... ...
@@ -934,6 +934,7 @@ For example:
934 934
     Goroutines: 9
935 935
     EventsListeners: 0
936 936
     Init Path: /usr/bin/docker
937
+    Docker Root Dir: /var/lib/docker
937 938
     Username: svendowideit
938 939
     Registry: [https://index.docker.io/v1/]
939 940
     Labels: