mirror of https://github.com/docker/cli.git
run.md: --expose does NOT override Dockerfile EXPOSE
run.md states that the operator can override all defaults set in the Dockerfile, and explicitly says that `--expose` overrides the `EXPOSE` instruction. Neither of these are true. An `EXPOSE` instruction cannot be overridden, `--expose` can only add additional exposed ports. This change fixes the instructions, and also takes the liberty of crisping up the grammar and phrasing in a place or two. Signed-off-by: Spencer Brown <spencer@spencerbrown.org>
This commit is contained in:
parent
4ddb2c2a8d
commit
a419da588f
|
@ -21,7 +21,7 @@ executes `docker run`, she starts a process with its own file system,
|
||||||
its own networking, and its own isolated process tree. The
|
its own networking, and its own isolated process tree. The
|
||||||
[*Image*](/reference/glossary/#image) which starts the process may define
|
[*Image*](/reference/glossary/#image) which starts the process may define
|
||||||
defaults related to the binary to run, the networking to expose, and
|
defaults related to the binary to run, the networking to expose, and
|
||||||
more, but `docker run` gives final control to the operator who starts
|
more, but `docker run` gives additional control to the operator who starts
|
||||||
the container from the image. That's the main reason
|
the container from the image. That's the main reason
|
||||||
[*run*](/reference/commandline/run) has more options than any
|
[*run*](/reference/commandline/run) has more options than any
|
||||||
other `docker` command.
|
other `docker` command.
|
||||||
|
@ -44,10 +44,9 @@ settings affect:
|
||||||
* runtime constraints on CPU and memory
|
* runtime constraints on CPU and memory
|
||||||
* privileges and LXC configuration
|
* privileges and LXC configuration
|
||||||
|
|
||||||
An image developer may set defaults for these same settings when they create the
|
An image developer may set defaults for these same settings when she creates the
|
||||||
image using the `docker build` command. Operators, however, can override all
|
image using the `docker build` command. Operators can use the `run` options to override most of the
|
||||||
defaults set by the developer using the `run` options. And, operators can also
|
defaults set by the developer. And, operators can override nearly all the defaults set by the Docker runtime itself.
|
||||||
override nearly all the defaults set by the Docker runtime itself.
|
|
||||||
|
|
||||||
Finally, depending on your Docker system configuration, you may be required to
|
Finally, depending on your Docker system configuration, you may be required to
|
||||||
preface each `docker` command with `sudo`. To avoid having to use `sudo` with
|
preface each `docker` command with `sudo`. To avoid having to use `sudo` with
|
||||||
|
@ -973,12 +972,11 @@ or two examples of how to pass more parameters to that ENTRYPOINT:
|
||||||
### EXPOSE (incoming ports)
|
### EXPOSE (incoming ports)
|
||||||
|
|
||||||
The Dockerfile doesn't give much control over networking, only providing
|
The Dockerfile doesn't give much control over networking, only providing
|
||||||
the `EXPOSE` instruction to give a hint to the operator about what
|
the `EXPOSE` instruction to specify incoming ports that provide services.
|
||||||
incoming ports might provide services. The following options work with
|
The following `run` command options work with container networking:
|
||||||
or override the Dockerfile's exposed defaults:
|
|
||||||
|
|
||||||
--expose=[]: Expose a port or a range of ports from the container
|
--expose=[]: Expose a port or a range of ports from the container,
|
||||||
without publishing it to your host
|
in addition to ports exposed by the `EXPOSE` Dockerfile instruction
|
||||||
-P=false : Publish all exposed ports to the host interfaces
|
-P=false : Publish all exposed ports to the host interfaces
|
||||||
-p=[] : Publish a container᾿s port or a range of ports to the host
|
-p=[] : Publish a container᾿s port or a range of ports to the host
|
||||||
format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort
|
format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort
|
||||||
|
|
Loading…
Reference in New Issue