• [6.9.0-rc2] Docker container br0 port mapping


    neruve
    • Urgent

    I am trying to expose a port on the br0 network (so the container can have it's own IP on my network) and I am unable to expose a port. Specifically, I have two instances of NPM, one on the 'proxynet' customer docker network, for reverse proxy from the outside, that one works fine. I have another instance of NPM for internal use, that is on the br0 network so I can map a dns record like i.network to that ip address and then use subdomains like speedtest.i.network to resolve services interally, however, I am unable to get it to use port 80 and 443. it keeps the same mapping of the other container no matter what I do. I believe this to be a bug.

     

    image.png.ac0565e49bc243a319e601e2a59f7763.png 

     

    I do not have any of the ports in the _internal container pointed to 4443 or 8080.... unless I am missing something, which I don't think I am. 

    I am marking this Urgent, please feel free to re-assign, if this is indeed a bug I do believe it needs to be set a priority to fix.

     

    I apologize if this has already been reported.




    User Feedback

    Recommended Comments

    Once you give the app a static IP, all port mappings are ignored as they are at that point irrelevant.  You just forward the applicable WAN port to the applicable LAN port for the IP

    Link to comment

    @Squid Thank you for the answer. I have a similar issue/requirement. Let me explain.

    • I'd like each docker container to run on its own IP address. And its' internal whatever port to be mapped to host's port 443 for HTTPS communication on that unique IP address.
    • I do still want to access Unraid GUI on its own IP on port 443 as well. I do not want to enter any port numbers in address bar.

    Example:

    1. Given Unraid GUI is running on IP=192.168.0.15 and listens on port 443 as I have added Let's Encrypt SSL cert manually
    2. And I have a docker container that I want to accesss from a different IP address ( like 192.168.0.20 )and on port 443(default for HTTPS) as well
    3. And internally, the container is listens to port 8888

    The question: How do I set up that container to be on IP 192.168.0.20? And to map host port 443 onto container's 8888?

     

    I have tried:

     

    One:

    1. -p 192.168.0.20:443:8888
    2. Network = eth0

    Result: docker selects some port, ignores the IP and port I selected. The container can be accesses only from that selection: eth0 192.168.0.2:8888/TCP192.168.0.2:8888

     

    Two:

    1. -p 192.168.0.20:443:8888
    2. Network = host

    Result: docker selects some port, ignores the IP and port I selected. The container can be accesses only from that selection: eth0 192.168.0.2:8888/TCP192.168.0.2:8888

     

    Three:

    1. Added 192.168.0.20 IP address on host as ip addr add 192.168.10.20/24 dev eth0
    2. -p 192.168.0.20:443:8888
    3. Network = bridge

    Result: Error starting userland proxy: listen tcp 192.168.0.20:443: bind: address already in use.

     

    Four:

    1. -p 192.168.0.30:443:8888
    2. Network = bridge

    Result: Error starting userland proxy: listen tcp 192.168.0.30:443: bind: cannot assign requested address.

     

    I might miss on smth with respect to networking in docker, any advice how to achieve the given task is appreciated. Or if it cannot be done then a clear answer why is also important, so I move on to another option (I have several spare LAN ports not used but available to UnRaid, so I was considering to set dockers on their own LAN network throw a nginx proxy)

     

    Edited by RusmanCool
    Link to comment

    When you give a container it’s own IP address then I think the host port setting is ignored and you can only use the port the container has configured.   I could be wrong about that but that is my understanding.

    • Thanks 1
    Link to comment

    @RusmanCool - Did you ever get to the bottom of this. I have a similar situation where I want to put swag, nextcloud and bitwarden in a vlan. This only works for one docker because I cannot give swag a custom IP, so only one docker can be accessed on 443. With the 'proxynet' network all the dockers work, but i dont want to use this as i dont want users to have access to the unraid host.

    Link to comment

    @showstopper, no, I have not. I have to use unraids's IP to map to nginx container, which in turn listens to 1443 port. I did setup DNS names for each of my containers, though each still points to my host unraid IP, but that allows a clean usage of nginx to direct calls to correct containers.

    Link to comment

    So, with br0 (so the container gets an ip on your network) ALL port mapping is ignored. It doesn't exist anylonger the service has to be accessed at the port the container uses internally.

    Example. If you put nginx on br0 and give it a 192.168.10.25 ip address, you could go to http://192.168.10.25 (which would be port 80) or https://192.168.10.25 (which would be on port 443) BUT that only works with those ports. If you had a container that used 8080 and 8443 you would need to add the port to the url.

    if you don't want to have to put the port in the address bar, you would need to use a reverse proxy and a subdomain.

    Link to comment


    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.
    Note: Your post will require moderator approval before it will be visible.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Restore formatting

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


  • Status Definitions

     

    Open = Under consideration.

     

    Solved = The issue has been resolved.

     

    Solved version = The issue has been resolved in the indicated release version.

     

    Closed = Feedback or opinion better posted on our forum for discussion. Also for reports we cannot reproduce or need more information. In this case just add a comment and we will review it again.

     

    Retest = Please retest in latest release.


    Priority Definitions

     

    Minor = Something not working correctly.

     

    Urgent = Server crash, data loss, or other showstopper.

     

    Annoyance = Doesn't affect functionality but should be fixed.

     

    Other = Announcement or other non-issue.