Browse code

Add details for inspect command usage

Signed-off-by: Eric G. Noriega <egnoriega@users.noreply.github.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>

EG Noriega authored on 2017/03/11 02:08:41
Showing 1 changed files
... ...
@@ -30,13 +30,34 @@ Options:
30 30
 
31 31
 ## Description
32 32
 
33
-By default, `docker inspect` will render all results in a JSON array. If the container and
34
-image have the same name, this will return container JSON for unspecified type.
33
+Docker inspect provides detailed information on constructs controlled by Docker.
34
+
35
+By default, `docker inspect` will render results in a JSON array.
36
+
37
+## Request a custom response format (--format)
38
+
35 39
 If a format is specified, the given template will be executed for each result.
36 40
 
37 41
 Go's [text/template](http://golang.org/pkg/text/template/) package
38 42
 describes all the details of the format.
39 43
 
44
+## Specify target type (--type)
45
+
46
+`--type container|image|node|network|secret|service|volume|task|plugin`
47
+
48
+The `docker inspect` command matches any type of object by either ID or name.
49
+In some cases multiple type of objects (for example, a container and a volume)
50
+exist with the same name, making the result ambigious.
51
+
52
+To restrict `docker inspect` to a specific type of object, use the `--type`
53
+option.
54
+
55
+The following example inspects a _volume_ named "myvolume"
56
+
57
+```bash
58
+$ docker inspect --type=volume myvolume
59
+```
60
+
40 61
 ## Examples
41 62
 
42 63
 ### Get an instance's IP address