1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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>
This commit is contained in:
Michael Crosby 2014-12-03 15:29:54 -08:00
parent c8ccfcb930
commit 654da4e151
3 changed files with 5 additions and 0 deletions

View file

@ -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 {

View file

@ -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)
}

View file

@ -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: