Fix formatting in docker version

This commit is contained in:
Will Sargent 2019-01-26 12:34:34 -08:00 committed by GitHub
parent d38b8f44b1
commit f4a8ea2066
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -213,16 +213,23 @@ Images are just [templates for docker containers](https://docs.docker.com/engine
It is very important that you always know the current version of Docker you are currently running on at any point in time.This is very helpful because you get to know what features are compatible with what you have running. This is also important because you know what containers to run from the docker store when you are trying to get template containers. That said let see how to know what version of docker we have running currently It is very important that you always know the current version of Docker you are currently running on at any point in time.This is very helpful because you get to know what features are compatible with what you have running. This is also important because you know what containers to run from the docker store when you are trying to get template containers. That said let see how to know what version of docker we have running currently
* ['docker version'](https://docs.docker.com/engine/reference/commandline/version/) check what version of docker you have running * ['docker version'](https://docs.docker.com/engine/reference/commandline/version/) check what version of docker you have running
* [docker version [OPTIONS]]
Get the server version ```bash
$ docker version --format '{{.Server.Version}}' # Get the server version
docker version --format '{{.Server.Version}}'
```
1.8.0 In Docker 1.8.0 and higher, you can also dump the raw JSON data:
Dump raw JSON data
$ docker version --format '{{json .}}'
```bash
docker version --format '{{json .}}'
```
will provide the output in JSON format:
```json
{"Client":{"Version":"1.8.0","ApiVersion":"1.20","GitCommit":"f5bae0a","GoVersion":"go1.4.2","Os":"linux","Arch":"am"} {"Client":{"Version":"1.8.0","ApiVersion":"1.20","GitCommit":"f5bae0a","GoVersion":"go1.4.2","Os":"linux","Arch":"am"}
```
### Cleaning up ### Cleaning up