From 654da4e151c449725b6996d47b7ff33767e87da9 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Wed, 3 Dec 2014 15:29:54 -0800 Subject: [PATCH] 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 --- api/client/commands.go | 3 +++ daemon/info.go | 1 + docs/sources/reference/commandline/cli.md | 1 + 3 files changed, 5 insertions(+) diff --git a/api/client/commands.go b/api/client/commands.go index 6b97f3656..634017157 100644 --- a/api/client/commands.go +++ b/api/client/commands.go @@ -544,6 +544,9 @@ func (cli *DockerCli) CmdInfo(args ...string) error { if initPath := remoteInfo.Get("InitPath"); initPath != "" { fmt.Fprintf(cli.out, "Init Path: %s\n", initPath) } + if root := remoteInfo.Get("DockerRootDir"); root != "" { + fmt.Fprintf(cli.out, "Docker Root Dir: %s\n", root) + } } if len(remoteInfo.GetList("IndexServerAddress")) != 0 { diff --git a/daemon/info.go b/daemon/info.go index 2807adab3..518722b6c 100644 --- a/daemon/info.go +++ b/daemon/info.go @@ -76,6 +76,7 @@ func (daemon *Daemon) CmdInfo(job *engine.Job) engine.Status { v.Set("InitPath", initPath) v.SetInt("NCPU", runtime.NumCPU()) v.SetInt64("MemTotal", meminfo.MemTotal) + v.Set("DockerRootDir", daemon.Config().Root) if hostname, err := os.Hostname(); err == nil { v.Set("Name", hostname) } diff --git a/docs/sources/reference/commandline/cli.md b/docs/sources/reference/commandline/cli.md index c9989926c..9799914d5 100644 --- a/docs/sources/reference/commandline/cli.md +++ b/docs/sources/reference/commandline/cli.md @@ -934,6 +934,7 @@ For example: Goroutines: 9 EventsListeners: 0 Init Path: /usr/bin/docker + Docker Root Dir: /var/lib/docker Username: svendowideit Registry: [https://index.docker.io/v1/] Labels: