1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #15029 from azurezk/add-version-info

Add docker version info in /info request
This commit is contained in:
Alexandre Beslic 2015-09-21 11:44:11 -07:00
commit 40edb5f97c
8 changed files with 9 additions and 1 deletions

View file

@ -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 {

View file

@ -215,6 +215,7 @@ type Info struct {
Name string
Labels []string
ExperimentalBuild bool
ServerVersion string
}
// ExecStartCheck is a temp struct used by execStart

View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -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

View file

@ -25,7 +25,8 @@ func (s *DockerSuite) TestInfoApi(c *check.C) {
"NCPU",
"MemTotal",
"KernelVersion",
"Driver"}
"Driver",
"ServerVersion"}
out := string(body)
for _, linePrefix := range stringsToCheck {

View file

@ -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