Browse code

cli: Add server OS/Arch info to 'version' cmd

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>

Ahmet Alp Balkan authored on 2015/02/22 14:20:03
Showing 5 changed files
... ...
@@ -483,6 +483,7 @@ func (cli *DockerCli) CmdVersion(args ...string) error {
483 483
 	}
484 484
 	fmt.Fprintf(cli.out, "Go version (server): %s\n", remoteVersion.Get("GoVersion"))
485 485
 	fmt.Fprintf(cli.out, "Git commit (server): %s\n", remoteVersion.Get("GitCommit"))
486
+	fmt.Fprintf(cli.out, "OS/Arch (server): %s/%s\n", remoteVersion.Get("Os"), remoteVersion.Get("Arch"))
486 487
 	return nil
487 488
 }
488 489
 
... ...
@@ -46,6 +46,11 @@ You can still call an old version of the API using
46 46
 
47 47
 ### What's new
48 48
 
49
+`GET /version`
50
+
51
+**New!**
52
+This endpoint now returns `Os`, `Arch` and `KernelVersion`.
53
+
49 54
 ## v1.17
50 55
 
51 56
 ### Full Documentation
... ...
@@ -1471,10 +1471,13 @@ Show the docker version information
1471 1471
         Content-Type: application/json
1472 1472
 
1473 1473
         {
1474
-             "ApiVersion": "1.12",
1475
-             "Version": "0.2.2",
1476
-             "GitCommit": "5a2a5cc+CHANGES",
1477
-             "GoVersion": "go1.0.3"
1474
+             "Version": "1.5.0",
1475
+             "Os": "linux",
1476
+             "KernelVersion": "3.18.5-tinycore64",
1477
+             "GoVersion": "go1.4.1",
1478
+             "GitCommit": "a8a31ef",
1479
+             "Arch": "amd64",
1480
+             "ApiVersion": "1.18"
1478 1481
         }
1479 1482
 
1480 1483
 Status Codes:
... ...
@@ -2075,8 +2075,21 @@ for further details.
2075 2075
 
2076 2076
     Show the Docker version information.
2077 2077
 
2078
-Show the Docker version, API version, Git commit, and Go version of
2079
-both Docker client and daemon.
2078
+Show the Docker version, API version, Git commit, Go version and OS/architecture
2079
+of both Docker client and daemon. Example use:
2080
+
2081
+    $ sudo docker version
2082
+    Client version: 1.5.0
2083
+    Client API version: 1.17
2084
+    Go version (client): go1.4.1
2085
+    Git commit (client): a8a31ef
2086
+    OS/Arch (client): darwin/amd64
2087
+    Server version: 1.5.0
2088
+    Server API version: 1.17
2089
+    Go version (server): go1.4.1
2090
+    Git commit (server): a8a31ef
2091
+    OS/Arch (server): linux/amd64
2092
+
2080 2093
 
2081 2094
 ## wait
2082 2095
 
... ...
@@ -19,10 +19,12 @@ func TestVersionEnsureSucceeds(t *testing.T) {
19 19
 		"Client API version:",
20 20
 		"Go version (client):",
21 21
 		"Git commit (client):",
22
+		"OS/Arch (client):",
22 23
 		"Server version:",
23 24
 		"Server API version:",
24 25
 		"Go version (server):",
25 26
 		"Git commit (server):",
27
+		"OS/Arch (server):",
26 28
 	}
27 29
 
28 30
 	for _, linePrefix := range stringsToCheck {