Browse code

Merge pull request #10933 from ahmetalpbalkan/version-daemon-os-arch

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

Alexander Morozov authored on 2015/02/24 08:26:53
Showing 5 changed files
... ...
@@ -484,6 +484,7 @@ func (cli *DockerCli) CmdVersion(args ...string) error {
484 484
 	}
485 485
 	fmt.Fprintf(cli.out, "Go version (server): %s\n", remoteVersion.Get("GoVersion"))
486 486
 	fmt.Fprintf(cli.out, "Git commit (server): %s\n", remoteVersion.Get("GitCommit"))
487
+	fmt.Fprintf(cli.out, "OS/Arch (server): %s/%s\n", remoteVersion.Get("Os"), remoteVersion.Get("Arch"))
487 488
 	return nil
488 489
 }
489 490
 
... ...
@@ -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:
... ...
@@ -2072,8 +2072,21 @@ for further details.
2072 2072
 
2073 2073
     Show the Docker version information.
2074 2074
 
2075
-Show the Docker version, API version, Git commit, and Go version of
2076
-both Docker client and daemon.
2075
+Show the Docker version, API version, Git commit, Go version and OS/architecture
2076
+of both Docker client and daemon. Example use:
2077
+
2078
+    $ sudo docker version
2079
+    Client version: 1.5.0
2080
+    Client API version: 1.17
2081
+    Go version (client): go1.4.1
2082
+    Git commit (client): a8a31ef
2083
+    OS/Arch (client): darwin/amd64
2084
+    Server version: 1.5.0
2085
+    Server API version: 1.17
2086
+    Go version (server): go1.4.1
2087
+    Git commit (server): a8a31ef
2088
+    OS/Arch (server): linux/amd64
2089
+
2077 2090
 
2078 2091
 ## wait
2079 2092
 
... ...
@@ -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 {