Skip to content

Commit

Permalink
add docker server version to /info
Browse files Browse the repository at this point in the history
Signed-off-by: Zhang Kun <zkazure@gmail.com>
  • Loading branch information
azurezk committed Sep 21, 2015
1 parent 4a6e8c8 commit 7cf343d
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/client/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func (cli *DockerCli) CmdInfo(args ...string) error {

fmt.Fprintf(cli.out, "Containers: %d\n", info.Containers)
fmt.Fprintf(cli.out, "Images: %d\n", info.Images)
fmt.Fprintf(cli.out, "Engine Version: %s\n", info.ServerVersion)
ioutils.FprintfIfNotEmpty(cli.out, "Storage Driver: %s\n", info.Driver)
if info.DriverStatus != nil {
for _, pair := range info.DriverStatus {
Expand Down
1 change: 1 addition & 0 deletions api/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ type Info struct {
Name string
Labels []string
ExperimentalBuild bool
ServerVersion string
}

// ExecStartCheck is a temp struct used by execStart
Expand Down
1 change: 1 addition & 0 deletions daemon/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
DockerRootDir: daemon.config().Root,
Labels: daemon.config().Labels,
ExperimentalBuild: utils.ExperimentalBuild(),
ServerVersion: dockerversion.VERSION,
}

// TODO Windows. Refactor this more once sysinfo is refactored into
Expand Down
1 change: 1 addition & 0 deletions docs/reference/api/docker_remote_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ This section lists each version from latest to oldest. Each listing includes a
list of DNS options to be used in the container.
* `POST /build` now optionally takes a serialized map of build-time variables.
* `GET /events` now includes a `timenano` field, in addition to the existing `time` field.
* `GET /info` now lists engine version information.

### v1.20 API changes

Expand Down
1 change: 1 addition & 0 deletions docs/reference/api/docker_remote_api_v1.21.md
Original file line number Diff line number Diff line change
Expand Up @@ -1860,6 +1860,7 @@ Display system-wide information
},
"SwapLimit": false,
"SystemTime": "2015-03-10T11:11:23.730591467-07:00"
"ServerVersion": "1.9.0"
}

Status Codes:
Expand Down
1 change: 1 addition & 0 deletions docs/reference/commandline/info.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ For example:
$ docker -D info
Containers: 14
Images: 52
Engine Version: 1.9.0
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Expand Down
3 changes: 2 additions & 1 deletion integration-cli/docker_api_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ func (s *DockerSuite) TestInfoApi(c *check.C) {
"NCPU",
"MemTotal",
"KernelVersion",
"Driver"}
"Driver",
"ServerVersion"}

out := string(body)
for _, linePrefix := range stringsToCheck {
Expand Down
1 change: 1 addition & 0 deletions man/docker-info.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Here is a sample output:
# docker info
Containers: 14
Images: 52
Engine Version: 1.9.0
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Dirs: 80
Expand Down

0 comments on commit 7cf343d

Please sign in to comment.