Browse code

Fixes some docs issues with using single-dash arguments where they should be double

I found a bunch of issues where we have "-<opt>" instead of "--<opt>".
Also a couple of other issues, like "-notrunc", which is now "--no-trunc"
Fixes #5963

Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)

Brian Goff authored on 2014/05/21 22:35:22
Showing 8 changed files
... ...
@@ -164,7 +164,7 @@ and foreground Docker containers.
164 164
 Docker container. This is because by default a container is not allowed to
165 165
 access any devices. A “privileged” container is given access to all devices.
166 166
 
167
-When the operator executes **docker run -privileged**, Docker will enable access
167
+When the operator executes **docker run --privileged**, Docker will enable access
168 168
 to all devices on the host as well as set some configuration in AppArmor to
169 169
 allow the container nearly all the same access to the host as processes running
170 170
 outside of a container on the host.
... ...
@@ -317,7 +317,7 @@ fedora-data image:
317 317
     # docker run --name=data -v /var/volume1 -v /tmp/volume2 -i -t fedora-data true
318 318
     # docker run --volumes-from=data --name=fedora-container1 -i -t fedora bash
319 319
 
320
-Multiple -volumes-from parameters will bring together multiple data volumes from
320
+Multiple --volumes-from parameters will bring together multiple data volumes from
321 321
 multiple containers. And it's possible to mount the volumes that came from the
322 322
 DATA container in yet another container via the fedora-container1 intermidiery
323 323
 container, allowing to abstract the actual data source from users of that data:
... ...
@@ -245,7 +245,7 @@ docker run --volumes-from=data --name=fedora-container1 -i -t fedora bash
245 245
 .RE
246 246
 .sp
247 247
 .TP
248
-Multiple -volumes-from parameters will bring together multiple data volumes from multiple containers. And it's possible to mount the volumes that came from the DATA container in yet another container via the fedora-container1 intermidiery container, allowing to abstract the actual data source from users of that data:
248
+Multiple --volumes-from parameters will bring together multiple data volumes from multiple containers. And it's possible to mount the volumes that came from the DATA container in yet another container via the fedora-container1 intermidiery container, allowing to abstract the actual data source from users of that data:
249 249
 .sp
250 250
 .RS
251 251
 docker run --volumes-from=fedora-container1 --name=fedora-container2 -i -t fedora bash
... ...
@@ -50,7 +50,7 @@ For Docker containers using cgroups, the container name will be the full
50 50
 ID or long ID of the container. If a container shows up as ae836c95b4c3
51 51
 in `docker ps`, its long ID might be something like
52 52
 `ae836c95b4c3c9e9179e0e91015512da89fdec91612f63cebae57df9a5444c79`. You can
53
-look it up with `docker inspect` or `docker ps -notrunc`.
53
+look it up with `docker inspect` or `docker ps --no-trunc`.
54 54
 
55 55
 Putting everything together to look at the memory metrics for a Docker
56 56
 container, take a look at `/sys/fs/cgroup/memory/lxc/<longid>/`.
... ...
@@ -84,7 +84,7 @@ Build an image from the Dockerfile assign it a name.
84 84
 
85 85
 And run the PostgreSQL server container (in the foreground):
86 86
 
87
-    $ sudo docker run -rm -P -name pg_test eg_postgresql
87
+    $ sudo docker run --rm -P --name pg_test eg_postgresql
88 88
 
89 89
 There are 2 ways to connect to the PostgreSQL server. We can use [*Link
90 90
 Containers*](/use/working_with_links_names/#working-with-links-names),
... ...
@@ -101,7 +101,7 @@ Containers can be linked to another container's ports directly using
101 101
 `docker run`. This will set a number of environment
102 102
 variables that can then be used to connect:
103 103
 
104
-    $ sudo docker run -rm -t -i -link pg_test:pg eg_postgresql bash
104
+    $ sudo docker run --rm -t -i --link pg_test:pg eg_postgresql bash
105 105
 
106 106
     postgres@7ef98b1b7243:/$ psql -h $PG_PORT_5432_TCP_ADDR -p $PG_PORT_5432_TCP_PORT -d docker -U docker --password
107 107
 
... ...
@@ -143,7 +143,7 @@ prompt, you can create a table and populate it.
143 143
 You can use the defined volumes to inspect the PostgreSQL log files and
144 144
 to backup your configuration and data:
145 145
 
146
-    $ docker run -rm --volumes-from pg_test -t -i busybox sh
146
+    $ docker run --rm --volumes-from pg_test -t -i busybox sh
147 147
 
148 148
     / # ls
149 149
     bin      etc      lib      linuxrc  mnt      proc     run      sys      usr
... ...
@@ -51,7 +51,7 @@ the `$URL` variable. The container is given a name
51 51
 While this example is simple, you could run any number of interactive
52 52
 commands, try things out, and then exit when you're done.
53 53
 
54
-    $ sudo docker run -i -t -name pybuilder_run shykes/pybuilder bash
54
+    $ sudo docker run -i -t --name pybuilder_run shykes/pybuilder bash
55 55
 
56 56
     $$ URL=http://github.com/shykes/helloflask/archive/master.tar.gz
57 57
     $$ /usr/local/bin/buildapp $URL
... ...
@@ -34,23 +34,23 @@ controlled entirely from the `docker run` parameters.
34 34
 
35 35
 Start actual Redis server on one Docker host
36 36
 
37
-    big-server $ docker run -d -name redis crosbymichael/redis
37
+    big-server $ docker run -d --name redis crosbymichael/redis
38 38
 
39 39
 Then add an ambassador linked to the Redis server, mapping a port to the
40 40
 outside world
41 41
 
42
-    big-server $ docker run -d -link redis:redis -name redis_ambassador -p 6379:6379 svendowideit/ambassador
42
+    big-server $ docker run -d --link redis:redis --name redis_ambassador -p 6379:6379 svendowideit/ambassador
43 43
 
44 44
 On the other host, you can set up another ambassador setting environment
45 45
 variables for each remote port we want to proxy to the `big-server`
46 46
 
47
-    client-server $ docker run -d -name redis_ambassador -expose 6379 -e REDIS_PORT_6379_TCP=tcp://192.168.1.52:6379 svendowideit/ambassador
47
+    client-server $ docker run -d --name redis_ambassador --expose 6379 -e REDIS_PORT_6379_TCP=tcp://192.168.1.52:6379 svendowideit/ambassador
48 48
 
49 49
 Then on the `client-server` host, you can use a Redis client container
50 50
 to talk to the remote Redis server, just by linking to the local Redis
51 51
 ambassador.
52 52
 
53
-    client-server $ docker run -i -t -rm -link redis_ambassador:redis relateiq/redis-cli
53
+    client-server $ docker run -i -t --rm --link redis_ambassador:redis relateiq/redis-cli
54 54
     redis 172.17.0.160:6379> ping
55 55
     PONG
56 56
 
... ...
@@ -62,19 +62,19 @@ does automatically (with a tiny amount of `sed`)
62 62
 On the Docker host (192.168.1.52) that Redis will run on:
63 63
 
64 64
     # start actual redis server
65
-    $ docker run -d -name redis crosbymichael/redis
65
+    $ docker run -d --name redis crosbymichael/redis
66 66
 
67 67
     # get a redis-cli container for connection testing
68 68
     $ docker pull relateiq/redis-cli
69 69
 
70 70
     # test the redis server by talking to it directly
71
-    $ docker run -t -i -rm -link redis:redis relateiq/redis-cli
71
+    $ docker run -t -i --rm --link redis:redis relateiq/redis-cli
72 72
     redis 172.17.0.136:6379> ping
73 73
     PONG
74 74
     ^D
75 75
 
76 76
     # add redis ambassador
77
-    $ docker run -t -i -link redis:redis -name redis_ambassador -p 6379:6379 busybox sh
77
+    $ docker run -t -i --link redis:redis --name redis_ambassador -p 6379:6379 busybox sh
78 78
 
79 79
 In the `redis_ambassador` container, you can see the linked Redis
80 80
 containers `env`:
... ...
@@ -98,7 +98,7 @@ to the world (via the `-p 6379:6379` port mapping):
98 98
 
99 99
     $ docker rm redis_ambassador
100 100
     $ sudo ./contrib/mkimage-unittest.sh
101
-    $ docker run -t -i -link redis:redis -name redis_ambassador -p 6379:6379 docker-ut sh
101
+    $ docker run -t -i --link redis:redis --name redis_ambassador -p 6379:6379 docker-ut sh
102 102
 
103 103
     $ socat TCP4-LISTEN:6379,fork,reuseaddr TCP4:172.17.0.136:6379
104 104
 
... ...
@@ -107,14 +107,14 @@ Now ping the Redis server via the ambassador:
107 107
 Now go to a different server:
108 108
 
109 109
     $ sudo ./contrib/mkimage-unittest.sh
110
-    $ docker run -t -i  -expose 6379 -name redis_ambassador docker-ut sh
110
+    $ docker run -t -i --expose 6379 --name redis_ambassador docker-ut sh
111 111
 
112 112
     $ socat TCP4-LISTEN:6379,fork,reuseaddr TCP4:192.168.1.52:6379
113 113
 
114 114
 And get the `redis-cli` image so we can talk over the ambassador bridge.
115 115
 
116 116
     $ docker pull relateiq/redis-cli
117
-    $ docker run -i -t -rm -link redis_ambassador:redis relateiq/redis-cli
117
+    $ docker run -i -t --rm --link redis_ambassador:redis relateiq/redis-cli
118 118
     redis 172.17.0.160:6379> ping
119 119
     PONG
120 120
 
... ...
@@ -139,9 +139,9 @@ case `192.168.1.52:6379`.
139 139
     #   docker build -t SvenDowideit/ambassador .
140 140
     #   docker tag SvenDowideit/ambassador ambassador
141 141
     # then to run it (on the host that has the real backend on it)
142
-    #   docker run -t -i -link redis:redis -name redis_ambassador -p 6379:6379 ambassador
142
+    #   docker run -t -i --link redis:redis --name redis_ambassador -p 6379:6379 ambassador
143 143
     # on the remote host, you can set up another ambassador
144
-    #   docker run -t -i -name redis_ambassador -expose 6379 sh
144
+    #   docker run -t -i --name redis_ambassador --expose 6379 sh
145 145
 
146 146
     FROM    docker-ut
147 147
     MAINTAINER      SvenDowideit@home.org.au
... ...
@@ -47,7 +47,7 @@ Or, you can use the `VOLUME` instruction in a `Dockerfile` to add one or
47 47
 more new volumes to any container created from that image:
48 48
 
49 49
     # BUILD-USING:        $ docker build -t data .
50
-    # RUN-USING:          $ docker run -name DATA data
50
+    # RUN-USING:          $ docker run --name DATA data
51 51
     FROM          busybox
52 52
     VOLUME        ["/var/volume1", "/var/volume2"]
53 53
     CMD           ["/bin/true"]
... ...
@@ -62,11 +62,11 @@ it.
62 62
 Create a named container with volumes to share (`/var/volume1` and
63 63
 `/var/volume2`):
64 64
 
65
-    $ docker run -v /var/volume1 -v /var/volume2 -name DATA busybox true
65
+    $ docker run -v /var/volume1 -v /var/volume2 --name DATA busybox true
66 66
 
67 67
 Then mount those data volumes into your application containers:
68 68
 
69
-    $ docker run -t -i -rm -volumes-from DATA -name client1 ubuntu bash
69
+    $ docker run -t -i --rm --from DATA --name client1 ubuntu bash
70 70
 
71 71
 You can use multiple `-volumes-from` parameters to bring together
72 72
 multiple data volumes from multiple containers.
... ...
@@ -75,7 +75,7 @@ Interestingly, you can mount the volumes that came from the `DATA`
75 75
 container in yet another container via the `client1` middleman
76 76
 container:
77 77
 
78
-    $ docker run -t -i -rm -volumes-from client1 -name client2 ubuntu bash
78
+    $ docker run -t -i --rm --volumes-from client1 --name client2 ubuntu bash
79 79
 
80 80
 This allows you to abstract the actual data source from users of that
81 81
 data, similar to [*Ambassador Pattern Linking*](
... ...
@@ -130,7 +130,7 @@ You cannot back up volumes using `docker export`, `docker save` and
130 130
 `--volumes-from` to start a new container that can access the
131 131
 data-container's volume. For example:
132 132
 
133
-    $ sudo docker run -rm --volumes-from DATA -v $(pwd):/backup busybox tar cvf /backup/backup.tar /data
133
+    $ sudo docker run --rm --volumes-from DATA -v $(pwd):/backup busybox tar cvf /backup/backup.tar /data
134 134
 
135 135
  - `-rm`:  
136 136
    remove the container when it exits
... ...
@@ -147,13 +147,13 @@ Then to restore to the same container, or another that you've made
147 147
 elsewhere:
148 148
 
149 149
     # create a new data container
150
-    $ sudo docker run -v /data -name DATA2 busybox true
150
+    $ sudo docker run -v /data --name DATA2 busybox true
151 151
     # untar the backup files into the new container᾿s data volume
152
-    $ sudo docker run -rm --volumes-from DATA2 -v $(pwd):/backup busybox tar xvf /backup/backup.tar
152
+    $ sudo docker run --rm --volumes-from DATA2 -v $(pwd):/backup busybox tar xvf /backup/backup.tar
153 153
     data/
154 154
     data/sven.txt
155 155
     # compare to the original container
156
-    $ sudo docker run -rm --volumes-from DATA -v `pwd`:/backup busybox ls /data
156
+    $ sudo docker run --rm --volumes-from DATA -v `pwd`:/backup busybox ls /data
157 157
     sven.txt
158 158
 
159 159
 You can use the basic techniques above to automate backup, migration and
... ...
@@ -73,7 +73,7 @@ user name or description:
73 73
 
74 74
     Search the docker index for images
75 75
 
76
-      -notrunc=false: Don᾿t truncate output
76
+      --no-trunc=false: Don᾿t truncate output
77 77
     $ sudo docker search centos
78 78
     Found 25 results matching your query ("centos")
79 79
     NAME                             DESCRIPTION