github.com/AliyunContainerService/cli@v0.0.0-20181009023821-814ced4b30d0/docs/reference/commandline/version.md (about) 1 --- 2 title: "version" 3 description: "The version command description and usage" 4 keywords: "version, architecture, api" 5 --- 6 7 <!-- This file is maintained within the docker/cli GitHub 8 repository at https://github.com/docker/cli/. Make all 9 pull requests against that repo. If you see this file in 10 another repository, consider it read-only there, as it will 11 periodically be overwritten by the definitive file. Pull 12 requests which include edits to this file in other repositories 13 will be rejected. 14 --> 15 16 # version 17 18 ```markdown 19 Usage: docker version [OPTIONS] 20 21 Show the Docker version information 22 23 Options: 24 -f, --format string Format the output using the given Go template 25 --help Print usage 26 --kubeconfig string Kubernetes config file 27 ``` 28 29 ## Description 30 31 By default, this will render all version information in an easy to read 32 layout. If a format is specified, the given template will be executed instead. 33 34 Go's [text/template](http://golang.org/pkg/text/template/) package 35 describes all the details of the format. 36 37 ## Examples 38 39 ### Default output 40 41 ```bash 42 $ docker version 43 44 Client: 45 Version: 1.8.0 46 API version: 1.20 47 Go version: go1.4.2 48 Git commit: f5bae0a 49 Built: Tue Jun 23 17:56:00 UTC 2015 50 OS/Arch: linux/amd64 51 52 Server: 53 Version: 1.8.0 54 API version: 1.20 55 Go version: go1.4.2 56 Git commit: f5bae0a 57 Built: Tue Jun 23 17:56:00 UTC 2015 58 OS/Arch: linux/amd64 59 ``` 60 61 ### Get the server version 62 63 ```bash 64 $ docker version --format '{{.Server.Version}}' 65 66 1.8.0 67 ``` 68 69 ### Dump raw JSON data 70 71 ```bash 72 $ docker version --format '{{json .}}' 73 74 {"Client":{"Version":"1.8.0","ApiVersion":"1.20","GitCommit":"f5bae0a","GoVersion":"go1.4.2","Os":"linux","Arch":"amd64","BuildTime":"Tue Jun 23 17:56:00 UTC 2015"},"ServerOK":true,"Server":{"Version":"1.8.0","ApiVersion":"1.20","GitCommit":"f5bae0a","GoVersion":"go1.4.2","Os":"linux","Arch":"amd64","KernelVersion":"3.13.2-gentoo","BuildTime":"Tue Jun 23 17:56:00 UTC 2015"}} 75 ```