Explorar el Código

Add Sockets (-H) list to `docker -D info`.

This will allow us to _know_ what the user's -H settings are, which may
be useful for debugging later.

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
Sven Dowideit hace 11 años
padre
commit
f54823bf05

+ 1 - 1
CONTRIBUTING.md

@@ -9,7 +9,7 @@ feels wrong or incomplete.
 When reporting [issues](https://github.com/dotcloud/docker/issues) 
 When reporting [issues](https://github.com/dotcloud/docker/issues) 
 on GitHub please include your host OS (Ubuntu 12.04, Fedora 19, etc),
 on GitHub please include your host OS (Ubuntu 12.04, Fedora 19, etc),
 the output of `uname -a` and the output of `docker version` along with
 the output of `uname -a` and the output of `docker version` along with
-the output of `docker info`. Please include the steps required to reproduce
+the output of `docker -D info`. Please include the steps required to reproduce
 the problem if possible and applicable.
 the problem if possible and applicable.
 This information will help us review and fix your issue faster.
 This information will help us review and fix your issue faster.
 
 

+ 3 - 0
api/client/commands.go

@@ -452,6 +452,9 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
 		if initPath := remoteInfo.Get("InitPath"); initPath != "" {
 		if initPath := remoteInfo.Get("InitPath"); initPath != "" {
 			fmt.Fprintf(cli.out, "Init Path: %s\n", initPath)
 			fmt.Fprintf(cli.out, "Init Path: %s\n", initPath)
 		}
 		}
+		if len(remoteInfo.GetList("Sockets")) != 0 {
+			fmt.Fprintf(cli.out, "Sockets: %v\n", remoteInfo.GetList("Sockets"))
+		}
 	}
 	}
 
 
 	if len(remoteInfo.GetList("IndexServerAddress")) != 0 {
 	if len(remoteInfo.GetList("IndexServerAddress")) != 0 {

+ 2 - 0
daemon/daemon.go

@@ -96,6 +96,7 @@ type Daemon struct {
 	containerGraph *graphdb.Database
 	containerGraph *graphdb.Database
 	driver         graphdriver.Driver
 	driver         graphdriver.Driver
 	execDriver     execdriver.Driver
 	execDriver     execdriver.Driver
+	Sockets        []string
 }
 }
 
 
 // Install installs daemon capabilities to eng.
 // Install installs daemon capabilities to eng.
@@ -878,6 +879,7 @@ func NewDaemonFromDirectory(config *daemonconfig.Config, eng *engine.Engine) (*D
 		sysInitPath:    sysInitPath,
 		sysInitPath:    sysInitPath,
 		execDriver:     ed,
 		execDriver:     ed,
 		eng:            eng,
 		eng:            eng,
+		Sockets:        config.Sockets,
 	}
 	}
 
 
 	if err := daemon.checkLocaldns(); err != nil {
 	if err := daemon.checkLocaldns(); err != nil {

+ 4 - 0
daemonconfig/config.go

@@ -31,6 +31,7 @@ type Config struct {
 	DisableNetwork              bool
 	DisableNetwork              bool
 	EnableSelinuxSupport        bool
 	EnableSelinuxSupport        bool
 	Context                     map[string][]string
 	Context                     map[string][]string
+	Sockets                     []string
 }
 }
 
 
 // ConfigFromJob creates and returns a new DaemonConfig object
 // ConfigFromJob creates and returns a new DaemonConfig object
@@ -66,6 +67,9 @@ func ConfigFromJob(job *engine.Job) *Config {
 		config.Mtu = GetDefaultNetworkMtu()
 		config.Mtu = GetDefaultNetworkMtu()
 	}
 	}
 	config.DisableNetwork = config.BridgeIface == DisableNetworkBridge
 	config.DisableNetwork = config.BridgeIface == DisableNetworkBridge
+	if sockets := job.GetenvList("Sockets"); sockets != nil {
+		config.Sockets = sockets
+	}
 
 
 	return config
 	return config
 }
 }

+ 1 - 0
docker/docker.go

@@ -162,6 +162,7 @@ func main() {
 			job.Setenv("ExecDriver", *flExecDriver)
 			job.Setenv("ExecDriver", *flExecDriver)
 			job.SetenvInt("Mtu", *flMtu)
 			job.SetenvInt("Mtu", *flMtu)
 			job.SetenvBool("EnableSelinuxSupport", *flSelinuxEnabled)
 			job.SetenvBool("EnableSelinuxSupport", *flSelinuxEnabled)
+			job.SetenvList("Sockets", flHosts.GetAll())
 			if err := job.Run(); err != nil {
 			if err := job.Run(); err != nil {
 				log.Fatal(err)
 				log.Fatal(err)
 			}
 			}

+ 7 - 0
docs/sources/reference/api/docker_remote_api_v1.11.md

@@ -1099,9 +1099,16 @@ Display system-wide information
         {
         {
              "Containers":11,
              "Containers":11,
              "Images":16,
              "Images":16,
+             "Driver":"btrfs",
+             "ExecutionDriver":"native-0.1",
+             "KernelVersion":"3.12.0-1-amd64"
              "Debug":false,
              "Debug":false,
              "NFd": 11,
              "NFd": 11,
              "NGoroutines":21,
              "NGoroutines":21,
+             "NEventsListener":0,
+             "InitPath":"/usr/bin/docker",
+             "Sockets":["unix:///var/run/docker.sock"],
+             "IndexServerAddress":["https://index.docker.io/v1/"],
              "MemoryLimit":true,
              "MemoryLimit":true,
              "SwapLimit":false,
              "SwapLimit":false,
              "IPv4Forwarding":true
              "IPv4Forwarding":true

+ 19 - 14
docs/sources/reference/commandline/cli.md

@@ -563,25 +563,30 @@ tar, then the ownerships might not get preserved.
 
 
 ## info
 ## info
 
 
-    Usage: docker info
 
 
-    Display system-wide information
+    Usage: docker info
 
 
 For example:
 For example:
 
 
-    $ sudo docker info
-    Containers: 292
-    Images: 194
+    $ sudo docker -D info
+    Containers: 16
+    Images: 2138
+    Storage Driver: btrfs
+    Execution Driver: native-0.1
+    Kernel Version: 3.12.0-1-amd64
     Debug mode (server): false
     Debug mode (server): false
-    Debug mode (client): false
-    Fds: 22
-    Goroutines: 67
-    LXC Version: 0.9.0
-    EventsListeners: 115
-    Kernel Version: 3.8.0-33-generic
-    WARNING: No swap limit support
-
-When sending issue reports, please use `docker version` and `docker info` to
+    Debug mode (client): true
+    Fds: 16
+    Goroutines: 104
+    EventsListeners: 0
+    Init Path: /usr/bin/docker
+    Sockets: [unix:///var/run/docker.sock tcp://0.0.0.0:4243]
+    Username: svendowideit
+    Registry: [https://index.docker.io/v1/]
+
+The global `-D` option tells all `docker` comands to output debug information.
+
+When sending issue reports, please use `docker version` and `docker -D info` to
 ensure we know how your setup is configured.
 ensure we know how your setup is configured.
 
 
 ## inspect
 ## inspect

+ 1 - 0
server/server.go

@@ -780,6 +780,7 @@ func (srv *Server) DockerInfo(job *engine.Job) engine.Status {
 	v.Set("IndexServerAddress", registry.IndexServerAddress())
 	v.Set("IndexServerAddress", registry.IndexServerAddress())
 	v.Set("InitSha1", dockerversion.INITSHA1)
 	v.Set("InitSha1", dockerversion.INITSHA1)
 	v.Set("InitPath", initPath)
 	v.Set("InitPath", initPath)
+	v.SetList("Sockets", srv.daemon.Sockets)
 	if _, err := v.WriteTo(job.Stdout); err != nil {
 	if _, err := v.WriteTo(job.Stdout); err != nil {
 		return job.Error(err)
 		return job.Error(err)
 	}
 	}