Container not respecting port settings


Recommended Posts

I'm running a container on a custom port but it appears to not be listening. The container is using Custom: br0 as it's network type and is set for a custom IP. When I add the container I set custom ports and the interface appears to show me the that it's actually using the custom ports I set on the docker page. But when I try to access it on those ports I get nothing. If I use the default port the container wanted to use I'm able to access the webpage. I also curiously found that even though the docker page shows the port mapping that I set if I click the container image button and select "WebUI" it launches the original default port.

 

It feels very much like the container is not listening to the custom ports I'm setting. Is there a place where I can find out what ports are being set when the container is launched in the terminal? Basically I'm trying to find the settings in the unraid system where the docker launch commands are stored.

Link to comment

When running on a custom IP address, any and all port mappings are ignored by the docker system itself because they don't particularly make sense in that context.  The container will instead use whatever ports that it wants.

 

Only with network bridge do the mappings work (when the IP is the same as the server)

 

I'd have to check out the display aberration that you're seeing 

Link to comment

You can see attached where I've defined the ports but obviously as you've said if I set a custom IP it ignores those. Possibly some sort of note indicating that when setting the network type to anything custom. It's difficult to show but when launching the WebUI from the docker page it uses the correct port instead of the ones I defined.

 

On a separate note, would it be possible to create a separate docker NAT for several other containers? Such that I want to setup a reverse proxy on 80 / 443 for several containers however I don't want to interfere with the unraid host UI running on 80 / 443. Basically have Unraid on 192.168.1.10 using 80/443 and then have a Traefik container on 192.168.1.20 on 80/443 and then have several containers not accessible from outside that Traefik will manage.

docker_ports_1.PNG

docker_ports_2.PNG

Link to comment
5 hours ago, Milspeccqb said:

It's difficult to show but when launching the WebUI from the docker page it uses the correct port instead of the ones I defined.

Because there's another entry in advanced view that defines the URL for the WebUI.  It always refers to the container port, and if the port is mapped (bridge) then it gets adjusted accordingly

Link to comment
  • 5 months later...
On 1/24/2022 at 6:23 PM, Squid said:

I'd have to check out the display aberration that you're seeing

I think it would be good to follow docker ps display about ports.

  1. Don't show port mappings for containers running on custom network and host network.
  2. Rename the column header "port mappings" to "ports". If container port is mapped to host, show something like "0.0.0.0:8920->8920/tcp". If the port is not mapped but exposed by container itself, show something like "8096/tcp".
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
Reply to this topic...

×   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.