mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-04 20:51:44 +00:00
add port redirection doc
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user