From 3346c2e4d9ce0cf92b056b6ddc883adf5b8beddd Mon Sep 17 00:00:00 2001 From: Ahmet Alp Balkan Date: Sat, 21 Feb 2015 21:20:03 -0800 Subject: [PATCH] cli: Add server OS/Arch info to 'version' cmd Signed-off-by: Ahmet Alp Balkan --- api/client/commands.go | 1 + docs/sources/reference/api/docker_remote_api.md | 5 +++++ .../reference/api/docker_remote_api_v1.18.md | 11 +++++++---- docs/sources/reference/commandline/cli.md | 17 +++++++++++++++-- integration-cli/docker_cli_version_test.go | 2 ++ 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/api/client/commands.go b/api/client/commands.go index 1668e6dde3..92c99dcf6d 100644 --- a/api/client/commands.go +++ b/api/client/commands.go @@ -483,6 +483,7 @@ func (cli *DockerCli) CmdVersion(args ...string) error { } 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, "OS/Arch (server): %s/%s\n", remoteVersion.Get("Os"), remoteVersion.Get("Arch")) return nil } diff --git a/docs/sources/reference/api/docker_remote_api.md b/docs/sources/reference/api/docker_remote_api.md index 66e86eb5aa..7d51498e14 100644 --- a/docs/sources/reference/api/docker_remote_api.md +++ b/docs/sources/reference/api/docker_remote_api.md @@ -46,6 +46,11 @@ You can still call an old version of the API using ### What's new +`GET /version` + +**New!** +This endpoint now returns `Os`, `Arch` and `KernelVersion`. + ## v1.17 ### Full Documentation diff --git a/docs/sources/reference/api/docker_remote_api_v1.18.md b/docs/sources/reference/api/docker_remote_api_v1.18.md index c302ec7395..72d184115b 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.18.md +++ b/docs/sources/reference/api/docker_remote_api_v1.18.md @@ -1471,10 +1471,13 @@ Show the docker version information Content-Type: application/json { - "ApiVersion": "1.12", - "Version": "0.2.2", - "GitCommit": "5a2a5cc+CHANGES", - "GoVersion": "go1.0.3" + "Version": "1.5.0", + "Os": "linux", + "KernelVersion": "3.18.5-tinycore64", + "GoVersion": "go1.4.1", + "GitCommit": "a8a31ef", + "Arch": "amd64", + "ApiVersion": "1.18" } Status Codes: diff --git a/docs/sources/reference/commandline/cli.md b/docs/sources/reference/commandline/cli.md index 87acc6cfb8..7f5c306c27 100644 --- a/docs/sources/reference/commandline/cli.md +++ b/docs/sources/reference/commandline/cli.md @@ -2075,8 +2075,21 @@ for further details. Show the Docker version information. -Show the Docker version, API version, Git commit, and Go version of -both Docker client and daemon. +Show the Docker version, API version, Git commit, Go version and OS/architecture +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 diff --git a/integration-cli/docker_cli_version_test.go b/integration-cli/docker_cli_version_test.go index 0759ba6767..ceaeba8e20 100644 --- a/integration-cli/docker_cli_version_test.go +++ b/integration-cli/docker_cli_version_test.go @@ -19,10 +19,12 @@ func TestVersionEnsureSucceeds(t *testing.T) { "Client API version:", "Go version (client):", "Git commit (client):", + "OS/Arch (client):", "Server version:", "Server API version:", "Go version (server):", "Git commit (server):", + "OS/Arch (server):", } for _, linePrefix := range stringsToCheck {