فهرست منبع

Merge pull request #16965 from mikebrow/docs-improvement-for-expose-16634

updating docs for EXPOSE option on run command
moxiegirl 9 سال پیش
والد
کامیت
9be87c9a96
3فایلهای تغییر یافته به همراه14 افزوده شده و 13 حذف شده
  1. 9 11
      docs/reference/builder.md
  2. 1 1
      man/Dockerfile.5.md
  3. 4 1
      man/docker-run.1.md

+ 9 - 11
docs/reference/builder.md

@@ -484,17 +484,15 @@ To view an image's labels, use the `docker inspect` command.
 
     EXPOSE <port> [<port>...]
 
-The `EXPOSE` instructions informs Docker that the container will listen on the
-specified network ports at runtime. Docker uses this information to interconnect
-containers using links (see the [Docker User
-Guide](../userguide/dockerlinks.md) and to determine which ports to expose to the
-host when [using the -P flag](run.md#expose-incoming-ports).
-
-> **Note**:
-> `EXPOSE` doesn't define which ports can be exposed to the host or make ports
-> accessible from the host by default. To expose ports to the host, at runtime,
-> [use the `-p` flag](../userguide/dockerlinks.md) or
-> [the -P flag](run.md#expose-incoming-ports).
+The `EXPOSE` instruction informs Docker that the container listens on the
+specified network ports at runtime. `EXPOSE` does not make the ports of the
+container accessible to the host. To do that, you must use either the `-p` flag
+to publish a range of ports or the `-P` flag to publish all of the exposed ports.
+You can expose one port number and publish it externally under another number.
+ 
+Docker uses exposed and published ports to interconnect containers using links
+(see [Linking containers together](../userguide/dockerlinks.md))
+and to set up port redirection on the host system when [using the -P flag](run.md#expose-incoming-ports).
 
 ## ENV
 

+ 1 - 1
man/Dockerfile.5.md

@@ -185,7 +185,7 @@ A Dockerfile is similar to a Makefile.
   -- `EXPOSE <port> [<port>...]`
   The **EXPOSE** instruction informs Docker that the container listens on the
   specified network ports at runtime. Docker uses this information to
-  interconnect containers using links, and to set up port redirection on the host
+  interconnect containers using links and to set up port redirection on the host
   system.
 
 **ENV**

+ 4 - 1
man/docker-run.1.md

@@ -223,7 +223,10 @@ ENTRYPOINT.
    Read in a line delimited file of environment variables
 
 **--expose**=[]
-   Expose a port, or a range of ports (e.g. --expose=3300-3310), from the container without publishing it to your host
+   Expose a port, or a range of ports (e.g. --expose=3300-3310) informs Docker
+that the container listens on the specified network ports at runtime. Docker
+uses this information to interconnect containers using links and to set up port
+redirection on the host system.
 
 **--group-add**=[]
    Add additional groups to run as