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

cli: Add server OS/Arch info to 'version' cmd
This commit is contained in:
Alexander Morozov 2015-02-23 15:26:53 -08:00
commit 02c8881596
5 changed files with 30 additions and 6 deletions

View File

@ -484,6 +484,7 @@ func (cli *DockerCli) CmdVersion(args ...string) error {
} }
fmt.Fprintf(cli.out, "Go version (server): %s\n", remoteVersion.Get("GoVersion")) fmt.Fprintf(cli.out, "Go version (server): %s\n", remoteVersion.Get("GoVersion"))
fmt.Fprintf(cli.out, "Git commit (server): %s\n", remoteVersion.Get("GitCommit")) fmt.Fprintf(cli.out, "Git commit (server): %s\n", remoteVersion.Get("GitCommit"))
fmt.Fprintf(cli.out, "OS/Arch (server): %s/%s\n", remoteVersion.Get("Os"), remoteVersion.Get("Arch"))
return nil return nil
} }

View File

@ -46,6 +46,11 @@ You can still call an old version of the API using
### What's new ### What's new
`GET /version`
**New!**
This endpoint now returns `Os`, `Arch` and `KernelVersion`.
## v1.17 ## v1.17
### Full Documentation ### Full Documentation

View File

@ -1471,10 +1471,13 @@ Show the docker version information
Content-Type: application/json Content-Type: application/json
{ {
"ApiVersion": "1.12", "Version": "1.5.0",
"Version": "0.2.2", "Os": "linux",
"GitCommit": "5a2a5cc+CHANGES", "KernelVersion": "3.18.5-tinycore64",
"GoVersion": "go1.0.3" "GoVersion": "go1.4.1",
"GitCommit": "a8a31ef",
"Arch": "amd64",
"ApiVersion": "1.18"
} }
Status Codes: Status Codes:

View File

@ -2072,8 +2072,21 @@ for further details.
Show the Docker version information. Show the Docker version information.
Show the Docker version, API version, Git commit, and Go version of Show the Docker version, API version, Git commit, Go version and OS/architecture
both Docker client and daemon. of both Docker client and daemon. Example use:
$ sudo docker version
Client version: 1.5.0
Client API version: 1.17
Go version (client): go1.4.1
Git commit (client): a8a31ef
OS/Arch (client): darwin/amd64
Server version: 1.5.0
Server API version: 1.17
Go version (server): go1.4.1
Git commit (server): a8a31ef
OS/Arch (server): linux/amd64
## wait ## wait

View File

@ -19,10 +19,12 @@ func TestVersionEnsureSucceeds(t *testing.T) {
"Client API version:", "Client API version:",
"Go version (client):", "Go version (client):",
"Git commit (client):", "Git commit (client):",
"OS/Arch (client):",
"Server version:", "Server version:",
"Server API version:", "Server API version:",
"Go version (server):", "Go version (server):",
"Git commit (server):", "Git commit (server):",
"OS/Arch (server):",
} }
for _, linePrefix := range stringsToCheck { for _, linePrefix := range stringsToCheck {