1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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)
This commit is contained in:
Sven Dowideit 2014-05-06 20:26:44 +10:00
parent 95d81dada6
commit 9eeff6d099
3 changed files with 20 additions and 20 deletions

View file

@ -809,33 +809,33 @@ Run a command in a new container
Usage: docker run [OPTIONS] IMAGE[:TAG] [COMMAND] [ARG...] Usage: docker run [OPTIONS] IMAGE[:TAG] [COMMAND] [ARG...]
-a, --attach=map[]: Attach to stdin, stdout or stderr -a, --attach=[]: Attach to stdin, stdout or stderr.
-c, --cpu-shares=0: CPU shares (relative weight) -c, --cpu-shares=0: CPU shares (relative weight)
--cidfile="": Write the container ID to the file --cidfile="": Write the container ID to the file
-d, --detach=false: Detached mode: Run container in the background, print new container id -d, --detach=false: Detached mode: Run container in the background, print new container id
--dns=[]: Set custom dns servers
--dns-search=[]: Set custom dns search domains
-e, --env=[]: Set environment variables -e, --env=[]: Set environment variables
--env-file="": Read in a line delimited file of ENV variables --entrypoint="": Overwrite the default entrypoint of the image
--env-file=[]: Read in a line delimited file of ENV variables
--expose=[]: Expose a port from the container without publishing it to your host
-h, --hostname="": Container host name -h, --hostname="": Container host name
-i, --interactive=false: Keep stdin open even if not attached -i, --interactive=false: Keep stdin open even if not attached
--privileged=false: Give extended privileges to this container --link=[]: Add link to another container (name:alias)
--lxc-conf=[]: (lxc exec-driver only) Add custom lxc options --lxc-conf="lxc.cgroup.cpuset.cpus = 0,1"
-m, --memory="": Memory limit (format: <number><optional unit>, where unit = b, k, m or g) -m, --memory="": Memory limit (format: <number><optional unit>, where unit = b, k, m or g)
-n, --networking=true: Enable networking for this container --name="": Assign a name to the container
-p, --publish=[]: Map a network port to the container --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
-P, --publish-all=false: Publish all exposed ports to the host interfaces
-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)
--privileged=false: Give extended privileges to this container
--rm=false: Automatically remove the container when it exits (incompatible with -d) --rm=false: Automatically remove the container when it exits (incompatible with -d)
--sig-proxy=true: Proxify all received signal to the process (even in non-tty mode)
-t, --tty=false: Allocate a pseudo-tty -t, --tty=false: Allocate a pseudo-tty
-u, --user="": Username or UID -u, --user="": Username or UID
--dns=[]: Set custom dns servers for the container -v, --volume=[]: Bind mount a volume (e.g. from the host: -v /host:/container, from docker: -v /container)
--dns-search=[]: Set custom DNS search domains for the container --volumes-from=[]: Mount volumes from the specified container(s)
-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.
--volumes-from="": Mount all volumes from the given container(s)
--entrypoint="": Overwrite the default entrypoint set by the image
-w, --workdir="": Working directory inside the container -w, --workdir="": Working directory inside the container
--lxc-conf=[]: (lxc exec-driver only) Add custom lxc options --lxc-conf="lxc.cgroup.cpuset.cpus = 0,1"
--sig-proxy=true: Proxify all received signal to the process (even in non-tty mode)
--expose=[]: Expose a port from the container without publishing it to your host
--link="": Add link to another container (name:alias)
--name="": Assign the specified name to the container. If no name is specific docker will generate a random name
-P, --publish-all=false: Publish all exposed ports to the host interfaces
The `docker run` command first `creates` a writeable container layer over the The `docker run` command first `creates` a writeable container layer over the
specified image, and then `starts` it using the specified command. That is, specified image, and then `starts` it using the specified command. That is,

View file

@ -136,12 +136,12 @@ PID files):
## Network Settings ## Network Settings
--dns=[] : Set custom dns servers for the container --dns=[] : Set custom dns servers for the container
--net=bridge : Set the network mode --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
By default, all containers have networking enabled and they can make any By default, all containers have networking enabled and they can make any
outgoing connections. The operator can completely disable networking outgoing connections. The operator can completely disable networking
with `docker run -n` which disables all incoming and with `docker run --net none` which disables all incoming and
outgoing networking. In cases like this, you would perform I/O through outgoing networking. In cases like this, you would perform I/O through
files or STDIN/STDOUT only. files or STDIN/STDOUT only.

View file

@ -62,7 +62,7 @@ func parseRun(cmd *flag.FlagSet, args []string, sysInfo *sysinfo.SysInfo) (*Conf
flUser = cmd.String([]string{"u", "-user"}, "", "Username or UID") flUser = cmd.String([]string{"u", "-user"}, "", "Username or UID")
flWorkingDir = cmd.String([]string{"w", "-workdir"}, "", "Working directory inside the container") flWorkingDir = cmd.String([]string{"w", "-workdir"}, "", "Working directory inside the container")
flCpuShares = cmd.Int64([]string{"c", "-cpu-shares"}, 0, "CPU shares (relative weight)") flCpuShares = cmd.Int64([]string{"c", "-cpu-shares"}, 0, "CPU shares (relative weight)")
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)") 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")
// For documentation purpose // For documentation purpose
_ = cmd.Bool([]string{"#sig-proxy", "-sig-proxy"}, true, "Proxify all received signal to the process (even in non-tty mode)") _ = cmd.Bool([]string{"#sig-proxy", "-sig-proxy"}, true, "Proxify all received signal to the process (even in non-tty mode)")
_ = cmd.String([]string{"#name", "-name"}, "", "Assign a name to the container") _ = cmd.String([]string{"#name", "-name"}, "", "Assign a name to the container")