Browse code

Auto-update documentation from the output of the cli.

I've re-jigged the run man page so that each option's text begins with the
cli's help text for that flag, and then ay subsequent lines in the man page
are carried forward.

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: SvenDowideit)

Sven Dowideit authored on 2014/11/28 13:21:55
Showing 19 changed files
... ...
@@ -104,6 +104,11 @@ def update_man_pages():
104 104
         re.MULTILINE | re.DOTALL
105 105
     )
106 106
 
107
+    options_re = re.compile(
108
+        r".*# OPTIONS(.*?)# (HISTORY|EXAMPLES?).*",
109
+        re.MULTILINE | re.DOTALL
110
+    )
111
+
107 112
     example_re = re.compile(
108 113
         r".*# EXAMPLES?(.*)# HISTORY.*",
109 114
         re.MULTILINE | re.DOTALL
... ...
@@ -116,8 +121,12 @@ def update_man_pages():
116 116
 
117 117
     for command in cmds:
118 118
         print "COMMAND: "+command
119
+        if command == "":
120
+            print "SKIPPING"
121
+            continue
119 122
         history = ""
120 123
         description = ""
124
+        original_options = ""
121 125
         examples = ""
122 126
         if os.path.isfile("docs/man/docker-"+command+".1.md"):
123 127
             intext = open("docs/man/docker-"+command+".1.md", "r")
... ...
@@ -126,6 +135,10 @@ def update_man_pages():
126 126
             match = desc_re.match(txt)
127 127
             if match:
128 128
                 description = match.group(1)
129
+            match = options_re.match(txt)
130
+            if match:
131
+                original_options = match.group(1)
132
+		#print "MATCHED OPTIONS\n" + original_options
129 133
             match = example_re.match(txt)
130 134
             if match:
131 135
                 examples = match.group(1)
... ...
@@ -170,7 +183,7 @@ def update_man_pages():
170 170
 
171 171
         # replace [OPTIONS] with the list of params
172 172
         options = ""
173
-        match = re.match("\[OPTIONS\](.*)", usage)
173
+        match = re.match("\[OPTIONS\]\s*(.*)", usage)
174 174
         if match:
175 175
             usage = match.group(1)
176 176
 
... ...
@@ -178,11 +191,13 @@ def update_man_pages():
178 178
         # TODO: sort without the `-`'s
179 179
         for key in sorted(params.keys(), key=lambda s: s.lower()):
180 180
             # split on commas, remove --?.*=.*, put in *'s mumble
181
+            flags = []
181 182
             ps = []
182 183
             opts = []
183 184
             for k in key_params[key].split(","):
184 185
                 match = re.match("(-+)([A-Za-z-0-9]*)(?:=(.*))?", k.lstrip())
185 186
                 if match:
187
+                    flags.append("{}{}".format(match.group(1), match.group(2)))
186 188
                     p = "**{}{}**".format(match.group(1), match.group(2))
187 189
                     o = "**{}{}**".format(match.group(1), match.group(2))
188 190
                     if match.group(3):
... ...
@@ -203,7 +218,25 @@ def update_man_pages():
203 203
                 else:
204 204
                     print "nomatch:{}".format(k)
205 205
             new_usage = "{}\n[{}]".format(new_usage, "|".join(ps))
206
+
206 207
             options = "{}{}\n   {}\n\n".format(options, ", ".join(opts), params[key])
208
+
209
+            # look at the original options documentation and if its hand written, add it too.
210
+            print "SVEN_re: "+flags[0]
211
+            singleoption_re = re.compile(
212
+                r".*[\r\n]\*\*"+flags[0]+"\*\*([^\r\n]*)[\r\n]+(.*?)[\r\n](\*\*-|# [A-Z]|\*\*[A-Z]+\*\*).*",
213
+                #r""+flags[0]+"(.*)(^\*\*-.*)?",
214
+                re.MULTILINE | re.DOTALL
215
+            )
216
+            match = singleoption_re.match(original_options)
217
+            if match:
218
+                info = match.group(2).strip()
219
+                print "MATCHED: " + match.group(1).strip()
220
+                if info != params[key].strip():
221
+                    #info = re.sub(params[key].strip(), '', info, flags=re.MULTILINE)
222
+                    print "INFO changed: " +info
223
+                    options = "{}   {}\n\n".format(options, info.strip())
224
+
207 225
         if new_usage != "":
208 226
             new_usage = "{}\n".format(new_usage.strip())
209 227
         usage = new_usage + usage
... ...
@@ -230,8 +263,8 @@ def update_man_pages():
230 230
             ".*{}.*".format(date_string),
231 231
             re.MULTILINE | re.DOTALL
232 232
         )
233
-        if not recent_history_re.match(history):
234
-            outtext.write("{}, updated by Sven Dowideit <SvenDowideit@home.org.au>\n".format(date_string))
233
+#        if not recent_history_re.match(history):
234
+#            outtext.write("{}, updated by Sven Dowideit <SvenDowideit@home.org.au>\n".format(date_string))
235 235
         outtext.close()
236 236
 
237 237
 # main
... ...
@@ -8,7 +8,7 @@ docker-attach - Attach to a running container
8 8
 **docker attach**
9 9
 [**--no-stdin**[=*false*]]
10 10
 [**--sig-proxy**[=*true*]]
11
- CONTAINER
11
+CONTAINER
12 12
 
13 13
 # DESCRIPTION
14 14
 If you **docker run** a container in detached mode (**-d**), you can reattach to
... ...
@@ -11,7 +11,7 @@ docker-build - Build a new image from the source code at PATH
11 11
 [**-q**|**--quiet**[=*false*]]
12 12
 [**--rm**[=*true*]]
13 13
 [**-t**|**--tag**[=*TAG*]]
14
- PATH | URL | -
14
+PATH | URL | -
15 15
 
16 16
 # DESCRIPTION
17 17
 This will read the Dockerfile from the directory specified in **PATH**.
... ...
@@ -9,7 +9,7 @@ docker-commit - Create a new image from a container's changes
9 9
 [**-a**|**--author**[=*AUTHOR*]]
10 10
 [**-m**|**--message**[=*MESSAGE*]]
11 11
 [**-p**|**--pause**[=*true*]]
12
- CONTAINER [REPOSITORY[:TAG]]
12
+CONTAINER [REPOSITORY[:TAG]]
13 13
 
14 14
 # DESCRIPTION
15 15
 Using an existing container's name or ID you can create a new image.
... ...
@@ -22,21 +22,24 @@ docker-create - Create a new container
22 22
 [**--expose**[=*[]*]]
23 23
 [**-h**|**--hostname**[=*HOSTNAME*]]
24 24
 [**-i**|**--interactive**[=*false*]]
25
+[**--ipc**[=*IPC*]]
25 26
 [**--link**[=*[]*]]
26 27
 [**--lxc-conf**[=*[]*]]
27 28
 [**-m**|**--memory**[=*MEMORY*]]
29
+[**--mac-address**[=*MAC-ADDRESS*]]
28 30
 [**--name**[=*NAME*]]
29 31
 [**--net**[=*"bridge"*]]
30 32
 [**-P**|**--publish-all**[=*false*]]
31 33
 [**-p**|**--publish**[=*[]*]]
32 34
 [**--privileged**[=*false*]]
33 35
 [**--restart**[=*RESTART*]]
36
+[**--security-opt**[=*[]*]]
34 37
 [**-t**|**--tty**[=*false*]]
35 38
 [**-u**|**--user**[=*USER*]]
36 39
 [**-v**|**--volume**[=*[]*]]
37 40
 [**--volumes-from**[=*[]*]]
38 41
 [**-w**|**--workdir**[=*WORKDIR*]]
39
- IMAGE [COMMAND] [ARG...]
42
+IMAGE [COMMAND] [ARG...]
40 43
 
41 44
 # OPTIONS
42 45
 **-a**, **--attach**=[]
... ...
@@ -87,6 +90,11 @@ docker-create - Create a new container
87 87
 **-i**, **--interactive**=*true*|*false*
88 88
    Keep STDIN open even if not attached. The default is *false*.
89 89
 
90
+**--ipc**=""
91
+   Default is to create a private IPC namespace (POSIX SysV IPC) for the container
92
+                               'container:<name|id>': reuses another container shared memory, semaphores and message queues
93
+                               'host': use the host shared memory,semaphores and message queues inside the container.  Note: the host mode gives the container full access to local shared memory and is therefore considered insecure.
94
+
90 95
 **--link**=[]
91 96
    Add link to another container in the form of name:alias
92 97
 
... ...
@@ -96,6 +104,9 @@ docker-create - Create a new container
96 96
 **-m**, **--memory**=""
97 97
    Memory limit (format: <number><optional unit>, where unit = b, k, m or g)
98 98
 
99
+**--mac-address**=""
100
+   Container MAC address (e.g. 92:d0:c6:0a:29:33)
101
+
99 102
 **--name**=""
100 103
    Assign a name to the container
101 104
 
... ...
@@ -120,6 +131,9 @@ docker-create - Create a new container
120 120
 **--restart**=""
121 121
    Restart policy to apply when a container exits (no, on-failure[:max-retry], always)
122 122
 
123
+**--security-opt**=[]
124
+   Security Options
125
+
123 126
 **-t**, **--tty**=*true*|*false*
124 127
    Allocate a pseudo-TTY. The default is *false*.
125 128
 
... ...
@@ -138,3 +152,4 @@ docker-create - Create a new container
138 138
 # HISTORY
139 139
 August 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>
140 140
 September 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>
141
+November 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>
... ...
@@ -1,6 +1,6 @@
1 1
 % DOCKER(1) Docker User Manuals
2 2
 % Docker Community
3
-% SEPT 2014
3
+% JUNE 2014
4 4
 # NAME
5 5
 docker-exec - Run a command in a running container
6 6
 
... ...
@@ -9,7 +9,7 @@ docker-exec - Run a command in a running container
9 9
 [**-d**|**--detach**[=*false*]]
10 10
 [**-i**|**--interactive**[=*false*]]
11 11
 [**-t**|**--tty**[=*false*]]
12
- CONTAINER COMMAND [ARG...]
12
+CONTAINER COMMAND [ARG...]
13 13
 
14 14
 # DESCRIPTION
15 15
 
... ...
@@ -19,17 +19,17 @@ The command started using `docker exec` will only run while the container's prim
19 19
 process (`PID 1`) is running, and will not be restarted if the container is restarted.
20 20
 
21 21
 If the container is paused, then the `docker exec` command will wait until the
22
-container is unpaused, and then run.
23
-
24
-# Options
22
+container is unpaused, and then run
25 23
 
24
+# OPTIONS
26 25
 **-d**, **--detach**=*true*|*false*
27
-   Detached mode. This runs the new process in the background.
26
+   Detached mode: run command in the background. The default is *false*.
28 27
 
29 28
 **-i**, **--interactive**=*true*|*false*
30
-   When set to true, keep STDIN open even if not attached. The default is false.
29
+   Keep STDIN open even if not attached. The default is *false*.
31 30
 
32 31
 **-t**, **--tty**=*true*|*false*
33
-   When set to true Docker can allocate a pseudo-tty and attach to the standard
34
-input of the process. This can be used, for example, to run a throwaway
35
-interactive shell. The default value is false.
32
+   Allocate a pseudo-TTY. The default is *false*.
33
+
34
+# HISTORY
35
+November 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>
... ...
@@ -8,7 +8,7 @@ docker-history - Show the history of an image
8 8
 **docker history**
9 9
 [**--no-trunc**[=*false*]]
10 10
 [**-q**|**--quiet**[=*false*]]
11
- IMAGE
11
+IMAGE
12 12
 
13 13
 # DESCRIPTION
14 14
 
... ...
@@ -10,7 +10,7 @@ docker-images - List images
10 10
 [**-f**|**--filter**[=*[]*]]
11 11
 [**--no-trunc**[=*false*]]
12 12
 [**-q**|**--quiet**[=*false*]]
13
- [REPOSITORY]
13
+[REPOSITORY]
14 14
 
15 15
 # DESCRIPTION
16 16
 This command lists the images stored in the local Docker repository.
... ...
@@ -7,7 +7,7 @@ docker-kill - Kill a running container using SIGKILL or a specified signal
7 7
 # SYNOPSIS
8 8
 **docker kill**
9 9
 [**-s**|**--signal**[=*"KILL"*]]
10
- CONTAINER [CONTAINER...]
10
+CONTAINER [CONTAINER...]
11 11
 
12 12
 # DESCRIPTION
13 13
 
... ...
@@ -9,7 +9,7 @@ docker-login - Register or log in to a Docker registry server, if no server is s
9 9
 [**-e**|**--email**[=*EMAIL*]]
10 10
 [**-p**|**--password**[=*PASSWORD*]]
11 11
 [**-u**|**--username**[=*USERNAME*]]
12
- [SERVER]
12
+[SERVER]
13 13
 
14 14
 # DESCRIPTION
15 15
 Register or Login to a docker registry server, if no server is
... ...
@@ -5,11 +5,15 @@
5 5
 docker-port - List port mappings for the CONTAINER, or lookup the public-facing port that is NAT-ed to the PRIVATE_PORT
6 6
 
7 7
 # SYNOPSIS
8
-**docker port** CONTAINER [PRIVATE_PORT[/PROTO]]
8
+**docker port**
9
+CONTAINER [PRIVATE_PORT[/PROTO]]
9 10
 
10 11
 # DESCRIPTION
11 12
 List port mappings for the CONTAINER, or lookup the public-facing port that is NAT-ed to the PRIVATE_PORT
12 13
 
14
+# OPTIONS
15
+There are no available options.
16
+
13 17
 # EXAMPLES
14 18
 You can find out all the ports mapped by not specifying a `PRIVATE_PORT`, or
15 19
 ask for just a specific mapping:
... ...
@@ -30,3 +34,4 @@ ask for just a specific mapping:
30 30
 # HISTORY
31 31
 April 2014, Originally compiled by William Henry (whenry at redhat dot com)
32 32
 June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>
33
+November 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>
... ...
@@ -32,6 +32,7 @@ the running containers.
32 32
 **-f**, **--filter**=[]
33 33
    Provide filter values. Valid filters:
34 34
                           exited=<int> - containers with exit code of <int>
35
+                          status=(restarting|running|paused|exited)
35 36
 
36 37
 **-l**, **--latest**=*true*|*false*
37 38
    Show only the latest created container, include non-running ones. The default is *false*.
... ...
@@ -74,3 +75,4 @@ April 2014, Originally compiled by William Henry (whenry at redhat dot com)
74 74
 based on docker.com source material and internal work.
75 75
 June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>
76 76
 August 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>
77
+November 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>
... ...
@@ -7,7 +7,7 @@ docker-restart - Restart a running container
7 7
 # SYNOPSIS
8 8
 **docker restart**
9 9
 [**-t**|**--time**[=*10*]]
10
- CONTAINER [CONTAINER...]
10
+CONTAINER [CONTAINER...]
11 11
 
12 12
 # DESCRIPTION
13 13
 Restart each container listed.
... ...
@@ -9,7 +9,7 @@ docker-rm - Remove one or more containers
9 9
 [**-f**|**--force**[=*false*]]
10 10
 [**-l**|**--link**[=*false*]]
11 11
 [**-v**|**--volumes**[=*false*]]
12
- CONTAINER [CONTAINER...]
12
+CONTAINER [CONTAINER...]
13 13
 
14 14
 # DESCRIPTION
15 15
 
... ...
@@ -23,26 +23,26 @@ docker-run - Run a command in a new container
23 23
 [**--expose**[=*[]*]]
24 24
 [**-h**|**--hostname**[=*HOSTNAME*]]
25 25
 [**-i**|**--interactive**[=*false*]]
26
-[**--ipc**[=*[]*]]
27
-[**--security-opt**[=*[]*]]
26
+[**--ipc**[=*IPC*]]
28 27
 [**--link**[=*[]*]]
29 28
 [**--lxc-conf**[=*[]*]]
30 29
 [**-m**|**--memory**[=*MEMORY*]]
30
+[**--mac-address**[=*MAC-ADDRESS*]]
31 31
 [**--name**[=*NAME*]]
32 32
 [**--net**[=*"bridge"*]]
33
-[**--mac-address**[=*MACADDRESS*]]
34 33
 [**-P**|**--publish-all**[=*false*]]
35 34
 [**-p**|**--publish**[=*[]*]]
36 35
 [**--privileged**[=*false*]]
37
-[**--restart**[=*POLICY*]]
36
+[**--restart**[=*RESTART*]]
38 37
 [**--rm**[=*false*]]
38
+[**--security-opt**[=*[]*]]
39 39
 [**--sig-proxy**[=*true*]]
40 40
 [**-t**|**--tty**[=*false*]]
41 41
 [**-u**|**--user**[=*USER*]]
42 42
 [**-v**|**--volume**[=*[]*]]
43 43
 [**--volumes-from**[=*[]*]]
44 44
 [**-w**|**--workdir**[=*WORKDIR*]]
45
- IMAGE [COMMAND] [ARG...]
45
+IMAGE [COMMAND] [ARG...]
46 46
 
47 47
 # DESCRIPTION
48 48
 
... ...
@@ -59,21 +59,26 @@ all image dependencies, from the repository in the same way running **docker
59 59
 pull** IMAGE, before it starts the container from that image.
60 60
 
61 61
 # OPTIONS
62
+**-a**, **--attach**=[]
63
+   Attach to STDIN, STDOUT or STDERR.
62 64
 
63
-**-a**, **--attach**=*stdin*|*stdout*|*stderr*
64
-   Attach to stdin, stdout or stderr. In foreground mode (the default when
65
-**-d** is not specified), **docker run** can start the process in the container
65
+   In foreground mode (the default when **-d**
66
+is not specified), **docker run** can start the process in the container
66 67
 and attach the console to the process’s standard input, output, and standard
67 68
 error. It can even pretend to be a TTY (this is what most commandline
68 69
 executables expect) and pass along signals. The **-a** option can be set for
69 70
 each of stdin, stdout, and stderr.
70 71
 
71
-**--add-host**=*hostname*:*ip*
72
+**--add-host**=[]
73
+   Add a custom host-to-IP mapping (host:ip)
74
+
72 75
    Add a line to /etc/hosts. The format is hostname:ip.  The **--add-host**
73 76
 option can be set multiple times.
74 77
 
75 78
 **-c**, **--cpu-shares**=0
76
-   CPU shares in relative weight. You can increase the priority of a container
79
+   CPU shares (relative weight)
80
+
81
+   You can increase the priority of a container
77 82
 with the -c option. By default, all containers run at the same priority and get
78 83
 the same proportion of CPU cycles, but you can tell the kernel to give more
79 84
 shares of CPU time to one or more containers when you start them via **docker
... ...
@@ -92,8 +97,9 @@ run**.
92 92
    CPUs in which to allow execution (0-3, 0,1)
93 93
 
94 94
 **-d**, **--detach**=*true*|*false*
95
-   Detached mode. This runs the container in the background. It outputs the new
96
-container's ID and any error messages. At any time you can run **docker ps** in
95
+   Detached mode: run the container in the background and print the new container ID. The default is *false*.
96
+
97
+   At any time you can run **docker ps** in
97 98
 the other shell to view a list of the running containers. You can reattach to a
98 99
 detached container with **docker attach**. If you choose to run a container in
99 100
 the detached mode, then you cannot use the **-rm** option.
... ...
@@ -107,19 +113,24 @@ stopping the process by pressing the keys CTRL-P CTRL-Q.
107 107
 **--dns-search**=[]
108 108
    Set custom DNS search domains (Use --dns-search=. if you don't wish to set the search domain)
109 109
 
110
-**--dns**=*IP-address*
111
-   Set custom DNS servers. This option can be used to override the DNS
110
+**--dns**=[]
111
+   Set custom DNS servers
112
+
113
+   This option can be used to override the DNS
112 114
 configuration passed to the container. Typically this is necessary when the
113 115
 host DNS configuration is invalid for the container (e.g., 127.0.0.1). When this
114 116
 is the case the **--dns** flags is necessary for every run.
115 117
 
116
-**-e**, **--env**=*environment*
117
-   Set environment variables. This option allows you to specify arbitrary
118
+**-e**, **--env**=[]
119
+   Set environment variables
120
+
121
+   This option allows you to specify arbitrary
118 122
 environment variables that are available for the process that will be launched
119 123
 inside of the container.
120 124
 
125
+**--entrypoint**=""
126
+   Overwrite the default ENTRYPOINT of the image
121 127
 
122
-**--entrypoint**=*command*
123 128
    This option allows you to overwrite the default entrypoint of the image that
124 129
 is set in the Dockerfile. The ENTRYPOINT of an image is similar to a COMMAND
125 130
 because it specifies what executable to run when the container starts, but it is
... ...
@@ -137,27 +148,25 @@ ENTRYPOINT.
137 137
 **--expose**=[]
138 138
    Expose a port or a range of ports (e.g. --expose=3300-3310) from the container without publishing it to your host
139 139
 
140
-**-h**, **--hostname**=*hostname*
140
+**-h**, **--hostname**=""
141
+   Container host name
142
+
141 143
    Sets the container host name that is available inside the container.
142 144
 
143 145
 **-i**, **--interactive**=*true*|*false*
146
+   Keep STDIN open even if not attached. The default is *false*.
147
+
144 148
    When set to true, keep stdin open even if not attached. The default is false.
145 149
 
146
-**--ipc**=[]
147
-   Set the IPC mode for the container
148
-     **container**:<*name*|*id*>: reuses another container's IPC stack
149
-     **host**: use the host's IPC stack inside the container.  
150
-     Note: the host mode gives the container full access to local IPC and is therefore considered insecure.
150
+**--ipc**=""
151
+   Default is to create a private IPC namespace (POSIX SysV IPC) for the container
152
+                               'container:<name|id>': reuses another container shared memory, semaphores and message queues
153
+                               'host': use the host shared memory,semaphores and message queues inside the container.  Note: the host mode gives the container full access to local shared memory and is therefore considered insecure.
151 154
 
152
-**--security-opt**=*secdriver*:*name*:*value*
153
-    "label:user:USER"   : Set the label user for the container
154
-    "label:role:ROLE"   : Set the label role for the container
155
-    "label:type:TYPE"   : Set the label type for the container
156
-    "label:level:LEVEL" : Set the label level for the container
157
-    "label:disable"     : Turn off label confinement for the container
155
+**--link**=[]
156
+   Add link to another container in the form of name:alias
158 157
 
159
-**--link**=*name*:*alias*
160
-   Add link to another container. The format is name:alias. If the operator
158
+   If the operator
161 159
 uses **--link** when starting the new client container, then the client
162 160
 container can access the exposed port via a private networking interface. Docker
163 161
 will set some environment variables in the client container to help indicate
... ...
@@ -166,7 +175,9 @@ which interface and port to use.
166 166
 **--lxc-conf**=[]
167 167
    (lxc exec-driver only) Add custom lxc options --lxc-conf="lxc.cgroup.cpuset.cpus = 0,1"
168 168
 
169
-**-m**, **--memory**=*memory-limit*
169
+**-m**, **--memory**=""
170
+   Memory limit (format: <number><optional unit>, where unit = b, k, m or g)
171
+
170 172
    Allows you to constrain the memory available to a container. If the host
171 173
 supports swap memory, then the -m memory setting can be larger than physical
172 174
 RAM. If a limit of 0 is specified, the container's memory is not limited. The
... ...
@@ -174,15 +185,23 @@ actual limit may be rounded up to a multiple of the operating system's page
174 174
 size, if it is not already. The memory limit should be formatted as follows:
175 175
 `<number><optional unit>`, where unit = b, k, m or g.
176 176
 
177
-**--name**=*name*
178
-   Assign a name to the container. The operator can identify a container in
179
-three ways:
177
+**--mac-address**=""
178
+   Container MAC address (e.g. 92:d0:c6:0a:29:33)
179
+
180
+   Remember that the MAC address in an Ethernet network must be unique.
181
+The IPv6 link-local address will be based on the device's MAC address
182
+according to RFC4862.
183
+
184
+**--name**=""
185
+   Assign a name to the container
186
+
187
+   The operator can identify a container in three ways:
180 188
 
181 189
     UUID long identifier (“f78375b1c487e03c9438c729345e54db9d20cfa2ac1fc3494b6eb60872e74778”)
182 190
     UUID short identifier (“f78375b1c487”)
183 191
     Name (“jonah”)
184 192
 
185
-The UUID identifiers come from the Docker daemon, and if a name is not assigned
193
+   The UUID identifiers come from the Docker daemon, and if a name is not assigned
186 194
 to the container with **--name** then the daemon will also generate a random
187 195
 string name. The name is useful when defining links (see **--link**) (or any
188 196
 other place you need to identify a container). This works for both background
... ...
@@ -190,21 +209,14 @@ and foreground Docker containers.
190 190
 
191 191
 **--net**="bridge"
192 192
    Set the Network mode for the container
193
-   **bridge**: creates a new network stack for the container on the docker bridge
194
-   **none**: no networking for this container
195
-   **container**:<*name*|*id*>: reuses another container's network stack
196
-   **host**: use the host network stack inside the container.  
197
-   Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure.
198
-
199
-**--mac-address**=*macaddress*
200
-   Set the MAC address for the container's Ethernet device:
201
-    --mac-address=12:34:56:78:9a:bc
202
-
203
-Remember that the MAC address in an Ethernet network must be unique.
204
-The IPv6 link-local address will be based on the device's MAC address
205
-according to RFC4862.
193
+                               'bridge': creates a new network stack for the container on the docker bridge
194
+                               'none': no networking for this container
195
+                               'container:<name|id>': reuses another container network stack
196
+                               'host': use the host network stack inside the container.  Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure.
206 197
 
207 198
 **-P**, **--publish-all**=*true*|*false*
199
+   Publish all exposed ports to the host interfaces. The default is *false*.
200
+
208 201
    When set to true publish all exposed ports to the host interfaces. The
209 202
 default is false. If the operator uses -P (or -p) then Docker will make the
210 203
 exposed port accessible on the host and the ports will be available to any
... ...
@@ -213,29 +225,44 @@ ports to a random port on the host between 49153 and 65535. To find the
213 213
 mapping between the host ports and the exposed ports, use **docker port**.
214 214
 
215 215
 **-p**, **--publish**=[]
216
-   Publish a container's port to the host (format: ip:hostPort:containerPort |
217
-ip::containerPort | hostPort:containerPort | containerPort) (use **docker port** to see the
218
-actual mapping)
216
+   Publish a container's port to the host
217
+                               format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort
218
+                               (use 'docker port' to see the actual mapping)
219 219
 
220 220
 **--privileged**=*true*|*false*
221
-   Give extended privileges to this container. By default, Docker containers are
221
+   Give extended privileges to this container. The default is *false*.
222
+
223
+   By default, Docker containers are
222 224
 “unprivileged” (=false) and cannot, for example, run a Docker daemon inside the
223 225
 Docker container. This is because by default a container is not allowed to
224 226
 access any devices. A “privileged” container is given access to all devices.
225 227
 
226
-When the operator executes **docker run --privileged**, Docker will enable access
228
+   When the operator executes **docker run --privileged**, Docker will enable access
227 229
 to all devices on the host as well as set some configuration in AppArmor to
228 230
 allow the container nearly all the same access to the host as processes running
229 231
 outside of a container on the host.
230 232
 
233
+**--restart**=""
234
+   Restart policy to apply when a container exits (no, on-failure[:max-retry], always)
231 235
 
232 236
 **--rm**=*true*|*false*
233 237
    Automatically remove the container when it exits (incompatible with -d). The default is *false*.
234 238
 
239
+**--security-opt**=[]
240
+   Security Options
241
+
242
+   "label:user:USER"   : Set the label user for the container
243
+    "label:role:ROLE"   : Set the label role for the container
244
+    "label:type:TYPE"   : Set the label type for the container
245
+    "label:level:LEVEL" : Set the label level for the container
246
+    "label:disable"     : Turn off label confinement for the container
247
+
235 248
 **--sig-proxy**=*true*|*false*
236 249
    Proxy received signals to the process (non-TTY mode only). SIGCHLD, SIGSTOP, and SIGKILL are not proxied. The default is *true*.
237 250
 
238 251
 **-t**, **--tty**=*true*|*false*
252
+   Allocate a pseudo-TTY. The default is *false*.
253
+
239 254
    When set to true Docker can allocate a pseudo-tty and attach to the standard
240 255
 input of any container. This can be used, for example, to run a throwaway
241 256
 interactive shell. The default is value is false.
... ...
@@ -243,52 +270,39 @@ interactive shell. The default is value is false.
243 243
 **-u**, **--user**=""
244 244
    Username or UID
245 245
 
246
+**-v**, **--volume**=[]
247
+   Bind mount a volume (e.g., from the host: -v /host:/container, from Docker: -v /container)
246 248
 
247
-**-v**, **--volume**=*volume*[:ro|:rw]
248
-   Bind mount a volume to the container.
249
-
250
-The **-v** option can be used one or
249
+   The **-v** option can be used one or
251 250
 more times to add one or more mounts to a container. These mounts can then be
252 251
 used in other containers using the **--volumes-from** option.
253 252
 
254
-The volume may be optionally suffixed with :ro or :rw to mount the volumes in
253
+   The volume may be optionally suffixed with :ro or :rw to mount the volumes in
255 254
 read-only or read-write mode, respectively. By default, the volumes are mounted
256 255
 read-write. See examples.
257 256
 
258
-**--volumes-from**=*container-id*[:ro|:rw]
257
+**--volumes-from**=[]
258
+   Mount volumes from the specified container(s)
259
+
259 260
    Will mount volumes from the specified container identified by container-id.
260 261
 Once a volume is mounted in a one container it can be shared with other
261 262
 containers using the **--volumes-from** option when running those other
262 263
 containers. The volumes can be shared even if the original container with the
263 264
 mount is not running.
264 265
 
265
-The container ID may be optionally suffixed with :ro or
266
+   The container ID may be optionally suffixed with :ro or
266 267
 :rw to mount the volumes in read-only or read-write mode, respectively. By
267 268
 default, the volumes are mounted in the same mode (read write or read only) as
268 269
 the reference container.
269 270
 
271
+**-w**, **--workdir**=""
272
+   Working directory inside the container
270 273
 
271
-**-w**, **--workdir**=*directory*
272
-   Working directory inside the container. The default working directory for
274
+   The default working directory for
273 275
 running binaries within a container is the root directory (/). The developer can
274 276
 set a different default with the Dockerfile WORKDIR instruction. The operator
275 277
 can override the working directory by using the **-w** option.
276 278
 
277
-
278
-**IMAGE**
279
-   The image name or ID. You can specify a version of an image you'd like to run
280
-   the container with by adding image:tag to the command. For example,
281
-   `docker run ubuntu:14.04`.
282
-
283
-
284
-
285
-**COMMAND**
286
-   The command or program to run inside the image.
287
-
288
-
289
-**ARG**
290
-   The arguments for the command to be run in the container.
291
-
292 279
 # EXAMPLES
293 280
 
294 281
 ## Exposing log messages from the container to the host's log
... ...
@@ -2,12 +2,12 @@
2 2
 % Docker Community
3 3
 % JUNE 2014
4 4
 # NAME
5
-docker-save - Save an image to a tar archive (streamed to STDOUT by default)
5
+docker-save - Save an image(s) to a tar archive (streamed to STDOUT by default)
6 6
 
7 7
 # SYNOPSIS
8 8
 **docker save**
9 9
 [**-o**|**--output**[=*OUTPUT*]]
10
-IMAGE
10
+IMAGE [IMAGE...]
11 11
 
12 12
 # DESCRIPTION
13 13
 Produces a tarred repository to the standard output stream. Contains all
... ...
@@ -35,3 +35,4 @@ fedora image to a fedora-latest.tar:
35 35
 April 2014, Originally compiled by William Henry (whenry at redhat dot com)
36 36
 based on docker.com source material and internal work.
37 37
 June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>
38
+November 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>
... ...
@@ -7,7 +7,7 @@ docker-stop - Stop a running container by sending SIGTERM and then SIGKILL after
7 7
 # SYNOPSIS
8 8
 **docker stop**
9 9
 [**-t**|**--time**[=*10*]]
10
- CONTAINER [CONTAINER...]
10
+CONTAINER [CONTAINER...]
11 11
 
12 12
 # DESCRIPTION
13 13
 Stop a running container (Send SIGTERM, and then SIGKILL after
... ...
@@ -7,7 +7,7 @@ docker-tag - Tag an image into a repository
7 7
 # SYNOPSIS
8 8
 **docker tag**
9 9
 [**-f**|**--force**[=*false*]]
10
- IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]NAME[:TAG]
10
+IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]NAME[:TAG]
11 11
 
12 12
 # DESCRIPTION
13 13
 This will give a new alias to an image in the repository. This refers to the
... ...
@@ -315,7 +315,6 @@ To kill the container, use `docker kill`.
315 315
 
316 316
       --force-rm=false     Always remove intermediate containers, even after unsuccessful builds
317 317
       --no-cache=false     Do not use cache when building the image
318
-      --pull=false         Always attempt to pull a newer version of the image
319 318
       -q, --quiet=false    Suppress the verbose output generated by the containers
320 319
       --rm=true            Remove intermediate containers after a successful build
321 320
       -t, --tag=""         Repository name (and optionally a tag) to be applied to the resulting image in case of success
... ...
@@ -538,11 +537,14 @@ Creates a new container.
538 538
       --expose=[]                Expose a port or a range of ports (e.g. --expose=3300-3310) from the container without publishing it to your host
539 539
       -h, --hostname=""          Container host name
540 540
       -i, --interactive=false    Keep STDIN open even if not attached
541
+      --ipc=""                   Default is to create a private IPC namespace (POSIX SysV IPC) for the container
542
+                                   'container:<name|id>': reuses another container shared memory, semaphores and message queues
543
+                                   'host': use the host shared memory,semaphores and message queues inside the container.  Note: the host mode gives the container full access to local shared memory and is therefore considered insecure.
541 544
       --link=[]                  Add link to another container in the form of name:alias
542 545
       --lxc-conf=[]              (lxc exec-driver only) Add custom lxc options --lxc-conf="lxc.cgroup.cpuset.cpus = 0,1"
543 546
       -m, --memory=""            Memory limit (format: <number><optional unit>, where unit = b, k, m or g)
547
+      --mac-address=""           Container MAC address (e.g. 92:d0:c6:0a:29:33)
544 548
       --name=""                  Assign a name to the container
545
-      --mac-address=""           Set the container's MAC address
546 549
       --net="bridge"             Set the Network mode for the container
547 550
                                    'bridge': creates a new network stack for the container on the docker bridge
548 551
                                    'none': no networking for this container
... ...
@@ -554,6 +556,7 @@ Creates a new container.
554 554
                                    (use 'docker port' to see the actual mapping)
555 555
       --privileged=false         Give extended privileges to this container
556 556
       --restart=""               Restart policy to apply when a container exits (no, on-failure[:max-retry], always)
557
+      --security-opt=[]          Security Options
557 558
       -t, --tty=false            Allocate a pseudo-TTY
558 559
       -u, --user=""              Username or UID
559 560
       -v, --volume=[]            Bind mount a volume (e.g., from the host: -v /host:/container, from Docker: -v /container)
... ...
@@ -614,10 +617,7 @@ For example:
614 614
     Usage: docker events [OPTIONS]
615 615
 
616 616
     Get real time events from the server
617
-      -f, --filter=[]    Provide filter values. Valid filters:
618
-                           event=<string> - event to filter
619
-                           image=<string> - image to filter
620
-                           container=<string> - container to filter
617
+
621 618
       --since=""         Show all events created since timestamp
622 619
       --until=""         Stream events until this timestamp
623 620
 
... ...
@@ -1321,9 +1321,13 @@ removed before the image is removed.
1321 1321
       --expose=[]                Expose a port or a range of ports (e.g. --expose=3300-3310) from the container without publishing it to your host
1322 1322
       -h, --hostname=""          Container host name
1323 1323
       -i, --interactive=false    Keep STDIN open even if not attached
1324
+      --ipc=""                   Default is to create a private IPC namespace (POSIX SysV IPC) for the container
1325
+                                   'container:<name|id>': reuses another container shared memory, semaphores and message queues
1326
+                                   'host': use the host shared memory,semaphores and message queues inside the container.  Note: the host mode gives the container full access to local shared memory and is therefore considered insecure.
1324 1327
       --link=[]                  Add link to another container in the form of name:alias
1325 1328
       --lxc-conf=[]              (lxc exec-driver only) Add custom lxc options --lxc-conf="lxc.cgroup.cpuset.cpus = 0,1"
1326 1329
       -m, --memory=""            Memory limit (format: <number><optional unit>, where unit = b, k, m or g)
1330
+      --mac-address=""           Container MAC address (e.g. 92:d0:c6:0a:29:33)
1327 1331
       --name=""                  Assign a name to the container
1328 1332
       --net="bridge"             Set the Network mode for the container
1329 1333
                                    'bridge': creates a new network stack for the container on the docker bridge
... ...
@@ -1337,6 +1341,7 @@ removed before the image is removed.
1337 1337
       --privileged=false         Give extended privileges to this container
1338 1338
       --restart=""               Restart policy to apply when a container exits (no, on-failure[:max-retry], always)
1339 1339
       --rm=false                 Automatically remove the container when it exits (incompatible with -d)
1340
+      --security-opt=[]          Security Options
1340 1341
       --sig-proxy=true           Proxy received signals to the process (non-TTY mode only). SIGCHLD, SIGSTOP, and SIGKILL are not proxied.
1341 1342
       -t, --tty=false            Allocate a pseudo-TTY
1342 1343
       -u, --user=""              Username or UID
... ...
@@ -1682,8 +1687,8 @@ more details on finding shared images from the command line.
1682 1682
 
1683 1683
     Restart a stopped container
1684 1684
 
1685
-      -a, --attach=false         Attach container's `STDOUT` and `STDERR` and forward all signals to the process
1686
-      -i, --interactive=false    Attach container's `STDIN`
1685
+      -a, --attach=false         Attach container's STDOUT and STDERR and forward all signals to the process
1686
+      -i, --interactive=false    Attach container's STDIN
1687 1687
 
1688 1688
 When run on a container that has already been started,
1689 1689
 takes no action and succeeds unconditionally.
... ...
@@ -1692,7 +1697,7 @@ takes no action and succeeds unconditionally.
1692 1692
 
1693 1693
     Usage: docker stop [OPTIONS] CONTAINER [CONTAINER...]
1694 1694
 
1695
-    Stop a running container by sending `SIGTERM` and then `SIGKILL` after a grace period
1695
+    Stop a running container by sending SIGTERM and then SIGKILL after a grace period
1696 1696
 
1697 1697
       -t, --time=10      Number of seconds to wait for the container to stop before killing it. Default is 10 seconds.
1698 1698