Browse code

Update the run --net cli help to include the 'host' option

and then add that to the run and cli docs

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)

Sven Dowideit authored on 2014/05/06 19:26:44
Showing 3 changed files
... ...
@@ -809,33 +809,33 @@ Run a command in a new container
809 809
 
810 810
     Usage: docker run [OPTIONS] IMAGE[:TAG] [COMMAND] [ARG...]
811 811
 
812
-    -a, --attach=map[]: Attach to stdin, stdout or stderr
812
+    -a, --attach=[]: Attach to stdin, stdout or stderr.
813 813
     -c, --cpu-shares=0: CPU shares (relative weight)
814 814
     --cidfile="": Write the container ID to the file
815 815
     -d, --detach=false: Detached mode: Run container in the background, print new container id
816
+    --dns=[]: Set custom dns servers
817
+    --dns-search=[]: Set custom dns search domains
816 818
     -e, --env=[]: Set environment variables
817
-    --env-file="": Read in a line delimited file of ENV variables
819
+    --entrypoint="": Overwrite the default entrypoint of the image
820
+    --env-file=[]: Read in a line delimited file of ENV variables
821
+    --expose=[]: Expose a port from the container without publishing it to your host
818 822
     -h, --hostname="": Container host name
819 823
     -i, --interactive=false: Keep stdin open even if not attached
820
-    --privileged=false: Give extended privileges to this container
824
+    --link=[]: Add link to another container (name:alias)
825
+    --lxc-conf=[]: (lxc exec-driver only) Add custom lxc options --lxc-conf="lxc.cgroup.cpuset.cpus = 0,1"
821 826
     -m, --memory="": Memory limit (format: <number><optional unit>, where unit = b, k, m or g)
822
-    -n, --networking=true: Enable networking for this container
823
-    -p, --publish=[]: Map a network port to the container
827
+    --name="": Assign a name to the container
828
+    --net="bridge": Set the Network mode for the container ('bridge': creates a new network stack for the container on the docker bridge, 'none': no networking for this container, 'container:<name|id>': reuses another container network stack), 'host': use the host network stack inside the container
829
+    -P, --publish-all=false: Publish all exposed ports to the host interfaces
830
+    -p, --publish=[]: Publish a container's port to the host (format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort) (use 'docker port' to see the actual mapping)
831
+    --privileged=false: Give extended privileges to this container
824 832
     --rm=false: Automatically remove the container when it exits (incompatible with -d)
833
+    --sig-proxy=true: Proxify all received signal to the process (even in non-tty mode)
825 834
     -t, --tty=false: Allocate a pseudo-tty
826 835
     -u, --user="": Username or UID
827
-    --dns=[]: Set custom dns servers for the container
828
-    --dns-search=[]: Set custom DNS search domains for the container
829
-    -v, --volume=[]: Create a bind mount to a directory or file with: [host-path]:[container-path]:[rw|ro]. If a directory "container-path" is missing, then docker creates a new volume.
830
-    --volumes-from="": Mount all volumes from the given container(s)
831
-    --entrypoint="": Overwrite the default entrypoint set by the image
836
+    -v, --volume=[]: Bind mount a volume (e.g. from the host: -v /host:/container, from docker: -v /container)
837
+    --volumes-from=[]: Mount volumes from the specified container(s)
832 838
     -w, --workdir="": Working directory inside the container
833
-    --lxc-conf=[]: (lxc exec-driver only) Add custom lxc options --lxc-conf="lxc.cgroup.cpuset.cpus = 0,1"
834
-    --sig-proxy=true: Proxify all received signal to the process (even in non-tty mode)
835
-    --expose=[]: Expose a port from the container without publishing it to your host
836
-    --link="": Add link to another container (name:alias)
837
-    --name="": Assign the specified name to the container. If no name is specific docker will generate a random name
838
-    -P, --publish-all=false: Publish all exposed ports to the host interfaces
839 839
 
840 840
 The `docker run` command first `creates` a writeable container layer over the
841 841
 specified image, and then `starts` it using the specified command. That is,
... ...
@@ -136,12 +136,12 @@ PID files):
136 136
 
137 137
 ## Network Settings
138 138
 
139
-    --dns=[]     : Set custom dns servers for the container
140
-    --net=bridge : Set the network mode
139
+    --dns=[]      : Set custom dns servers for the container
140
+    --net="bridge": Set the Network mode for the container ('bridge': creates a new network stack for the container on the docker bridge, 'none': no networking for this container, 'container:<name|id>': reuses another container network stack), 'host': use the host network stack inside the container
141 141
 
142 142
 By default, all containers have networking enabled and they can make any
143 143
 outgoing connections. The operator can completely disable networking
144
-with `docker run -n` which disables all incoming and
144
+with `docker run --net none` which disables all incoming and
145 145
 outgoing networking. In cases like this, you would perform I/O through
146 146
 files or STDIN/STDOUT only.
147 147
 
... ...
@@ -62,7 +62,7 @@ func parseRun(cmd *flag.FlagSet, args []string, sysInfo *sysinfo.SysInfo) (*Conf
62 62
 		flUser            = cmd.String([]string{"u", "-user"}, "", "Username or UID")
63 63
 		flWorkingDir      = cmd.String([]string{"w", "-workdir"}, "", "Working directory inside the container")
64 64
 		flCpuShares       = cmd.Int64([]string{"c", "-cpu-shares"}, 0, "CPU shares (relative weight)")
65
-		flNetMode         = cmd.String([]string{"-net"}, "bridge", "Set the Network mode for the container ('bridge': creates a new network stack for the container on the docker bridge, 'none': no networking for this container, 'container:<name|id>': reuses another container network stack)")
65
+		flNetMode         = cmd.String([]string{"-net"}, "bridge", "Set the Network mode for the container ('bridge': creates a new network stack for the container on the docker bridge, 'none': no networking for this container, 'container:<name|id>': reuses another container network stack), 'host': use the host network stack inside the container")
66 66
 		// For documentation purpose
67 67
 		_ = cmd.Bool([]string{"#sig-proxy", "-sig-proxy"}, true, "Proxify all received signal to the process (even in non-tty mode)")
68 68
 		_ = cmd.String([]string{"#name", "-name"}, "", "Assign a name to the container")