1
0
Fork 0
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:
Victor Vieux 2013-06-17 22:05:58 +02:00
parent 452128f0da
commit 36231345f1
2 changed files with 24 additions and 0 deletions

View file

@ -14,6 +14,7 @@ Contents:
basics
workingwithrepository
port_redirection
builder
puppet

View 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>