This commit is contained in:
Victor Vieux 2013-06-17 22:05:58 +02:00
Родитель 452128f0da
Коммит 36231345f1
2 изменённых файлов: 24 добавлений и 0 удалений

Просмотреть файл

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

Просмотреть файл

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