mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
add port redirection doc
This commit is contained in:
parent
452128f0da
commit
36231345f1
2 changed files with 24 additions and 0 deletions
|
@ -14,6 +14,7 @@ Contents:
|
|||
|
||||
basics
|
||||
workingwithrepository
|
||||
port_redirection
|
||||
builder
|
||||
puppet
|
||||
|
||||
|
|
23
docs/sources/use/port_redirection.rst
Normal file
23
docs/sources/use/port_redirection.rst
Normal file
|
@ -0,0 +1,23 @@
|
|||
:title: Port redirection
|
||||
:description: usage about port redirection
|
||||
:keywords: Usage, basic port, docker, documentation, examples
|
||||
|
||||
|
||||
Port redirection
|
||||
================
|
||||
|
||||
Port redirection is done on ``docker run`` using the -p flag.
|
||||
|
||||
Here are the 3 ways to redirect a port:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# the port 80 in the container is mapped to a random port of the host
|
||||
docker run -p 80 <image> <cmd>
|
||||
|
||||
# the port 80 in the container is mapped to the port 80 of the host
|
||||
docker run -p :80 <image> <cmd>
|
||||
|
||||
# the port 80 in the container is mapped to the port 5555 of the host
|
||||
docker run -p 5555:80 <image <cmd>
|
||||
|
Loading…
Reference in a new issue