[ 
https://issues.apache.org/jira/browse/YARN-5168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16685712#comment-16685712
 ] 

Eric Yang commented on YARN-5168:
---------------------------------

[~shaneku...@gmail.com] {quote}I believe supporting -P will lead to port 
conflicts. What if two containers running on the same NM both expose 
8080?{quote}

There is no port conflict when this is running on bridge network.  To put this 
in more concrete terms, container 1 runs on 172.18.0.2:8080 and container 2 
runs on 172.18.0.3:8080.  Both of the container exposed port 8080 using EXPOSE 
directive in Dockerfile.  The end result using -P parameter looks like:

{code}
CONTAINER ID        IMAGE               COMMAND                  CREATED        
     STATUS                    PORTS                                            
                                NAMES
204f3aeb5542        d                   "bash"                   11 seconds ago 
     Up 9 seconds              0.0.0.0:32769->8080/tcp                          
                                silly_hodgkin
8598c9af7368        d                   "bash"                   3 minutes ago  
     Up 3 minutes              0.0.0.0:32768->8080/tcp                          
                                musing_lamarr
{code}

This is inline with what you described.  I see an error my example JSON which 
doesn't expose which ephemeral port is on the host network.  I will update the 
example accordingly.

> Add port mapping handling when docker container use bridge network
> ------------------------------------------------------------------
>
>                 Key: YARN-5168
>                 URL: https://issues.apache.org/jira/browse/YARN-5168
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>            Reporter: Jun Gong
>            Assignee: Eric Yang
>            Priority: Major
>              Labels: Docker
>
> YARN-4007 addresses different network setups when launching the docker 
> container. We need support port mapping when docker container uses bridge 
> network.
> The following problems are what we faced:
> 1. Add "-P" to map docker container's exposed ports to automatically.
> 2. Add "-p" to let user specify specific ports to map.
> 3. Add service registry support for bridge network case, then app could find 
> each other. It could be done out of YARN, however it might be more convenient 
> to support it natively in YARN.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to