mirror of
https://github.com/wsargent/docker-cheat-sheet.git
synced 2025-09-22 05:40:50 +02:00
Merge pull request #165 from wsargent/fix-docker-version-formatting
Fix formatting in docker version
This commit is contained in:
commit
509c3d6061
1 changed files with 23 additions and 0 deletions
23
README.md
23
README.md
|
@ -231,6 +231,29 @@ Images are just [templates for docker containers](https://docs.docker.com/engine
|
||||||
* [`docker history`](https://docs.docker.com/engine/reference/commandline/history) shows history of image.
|
* [`docker history`](https://docs.docker.com/engine/reference/commandline/history) shows history of image.
|
||||||
* [`docker tag`](https://docs.docker.com/engine/reference/commandline/tag) tags an image to a name (local or registry).
|
* [`docker tag`](https://docs.docker.com/engine/reference/commandline/tag) tags an image to a name (local or registry).
|
||||||
|
|
||||||
|
## Checking Docker Version
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Get the server version
|
||||||
|
docker version --format '{{.Server.Version}}'
|
||||||
|
```
|
||||||
|
|
||||||
|
In Docker 1.8.0 and higher, you can also dump the raw JSON data:
|
||||||
|
|
||||||
|
```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"}
|
||||||
|
```
|
||||||
|
|
||||||
### Cleaning up
|
### Cleaning up
|
||||||
|
|
||||||
While you can use the `docker rmi` command to remove specific images, there's a tool called [docker-gc](https://github.com/spotify/docker-gc) that will safely clean up images that are no longer used by any containers. As of docker 1.13, `docker image prune` is also available for removing unused images. See [Prune](#prune).
|
While you can use the `docker rmi` command to remove specific images, there's a tool called [docker-gc](https://github.com/spotify/docker-gc) that will safely clean up images that are no longer used by any containers. As of docker 1.13, `docker image prune` is also available for removing unused images. See [Prune](#prune).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue