mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Match docs to actual port range used in code.
Addresses #7985 Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
This commit is contained in:
parent
ed7fb3bbda
commit
d6f4b2ebb4
3 changed files with 5 additions and 5 deletions
|
@ -310,13 +310,13 @@ page. There are two approaches.
|
||||||
First, you can supply `-P` or `--publish-all=true|false` to `docker run`
|
First, you can supply `-P` or `--publish-all=true|false` to `docker run`
|
||||||
which is a blanket operation that identifies every port with an `EXPOSE`
|
which is a blanket operation that identifies every port with an `EXPOSE`
|
||||||
line in the image's `Dockerfile` and maps it to a host port somewhere in
|
line in the image's `Dockerfile` and maps it to a host port somewhere in
|
||||||
the range 49000–49900. This tends to be a bit inconvenient, since you
|
the range 49153–65535. This tends to be a bit inconvenient, since you
|
||||||
then have to run other `docker` sub-commands to learn which external
|
then have to run other `docker` sub-commands to learn which external
|
||||||
port a given service was mapped to.
|
port a given service was mapped to.
|
||||||
|
|
||||||
More convenient is the `-p SPEC` or `--publish=SPEC` option which lets
|
More convenient is the `-p SPEC` or `--publish=SPEC` option which lets
|
||||||
you be explicit about exactly which external port on the Docker server —
|
you be explicit about exactly which external port on the Docker server —
|
||||||
which can be any port at all, not just those in the 49000–49900 block —
|
which can be any port at all, not just those in the 49153-65535 block —
|
||||||
you want mapped to which port in the container.
|
you want mapped to which port in the container.
|
||||||
|
|
||||||
Either way, you should be able to peek at what Docker has accomplished
|
Either way, you should be able to peek at what Docker has accomplished
|
||||||
|
|
|
@ -26,8 +26,8 @@ container that ran a Python Flask application:
|
||||||
> information on Docker networking [here](/articles/networking/).
|
> information on Docker networking [here](/articles/networking/).
|
||||||
|
|
||||||
When that container was created, the `-P` flag was used to automatically map any
|
When that container was created, the `-P` flag was used to automatically map any
|
||||||
network ports inside it to a random high port from the range 49000
|
network ports inside it to a random high port from the range 49153
|
||||||
to 49900 on our Docker host. Next, when `docker ps` was run, you saw that
|
to 65535 on our Docker host. Next, when `docker ps` was run, you saw that
|
||||||
port 5000 in the container was bound to port 49155 on the host.
|
port 5000 in the container was bound to port 49155 on the host.
|
||||||
|
|
||||||
$ sudo docker ps nostalgic_morse
|
$ sudo docker ps nostalgic_morse
|
||||||
|
|
|
@ -157,7 +157,7 @@ port) on port 49155.
|
||||||
|
|
||||||
Network port bindings are very configurable in Docker. In our last
|
Network port bindings are very configurable in Docker. In our last
|
||||||
example the `-P` flag is a shortcut for `-p 5000` that maps port 5000
|
example the `-P` flag is a shortcut for `-p 5000` that maps port 5000
|
||||||
inside the container to a high port (from the range 49000 to 49900) on
|
inside the container to a high port (from the range 49153 to 65535) on
|
||||||
the local Docker host. We can also bind Docker containers to specific
|
the local Docker host. We can also bind Docker containers to specific
|
||||||
ports using the `-p` flag, for example:
|
ports using the `-p` flag, for example:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue