Adds instruction about UDP port redirection

This commit is contained in:
Tommaso Visconti 2013-09-04 19:17:10 +02:00
parent 3a6868bc2f
commit ad5796de9f
1 changed files with 7 additions and 1 deletions

View File

@ -8,7 +8,7 @@
Port redirection Port redirection
================ ================
Docker can redirect public TCP ports to your container, so it can be Docker can redirect public TCP and UDP ports to your container, so it can be
reached over the network. Port redirection is done on ``docker run`` reached over the network. Port redirection is done on ``docker run``
using the -p flag. using the -p flag.
@ -25,6 +25,12 @@ will be allocated.
# PUBLIC port 80 is redirected to PRIVATE port 80 # PUBLIC port 80 is redirected to PRIVATE port 80
sudo docker run -p 80:80 <image> <cmd> sudo docker run -p 80:80 <image> <cmd>
To redirect a UDP port the redirection must be expressed as *PUBLIC:PRIVATE/udp*:
.. code-block:: bash
# PUBLIC port 5300 is redirected to the PRIVATE port 53 using UDP
sudo docker run -p 5300:53/udp <image> <cmd>
Default port redirects can be built into a container with the Default port redirects can be built into a container with the
``EXPOSE`` build command. ``EXPOSE`` build command.