Jump to content

Dockerman Support Publishing port with IP


Recommended Posts

I am not sure if this qualifies as a bug report or an enhancement because this is the first time i am attempting to use this feature. Docker supports publishing a port to a specific interface by specifying the IP address of the interface along with the port in the docker run command (docker run -p 192.168.0.55:9090:8080/tcp). Dockerman allows adding the IP in the port specification of the template and correctly translates it to the docker run command, however the dockerman gui is not fully on board. On the docker page the containers port listing still shows the port mapped to the IP address of the primary host interface. Additionally (and more importantly) if the container has a webui address specified with a template 'https://[IP]:[PORT:8080]' dockerman populates the IP field with the primary host IP address rather than the one specified for the port mapping.

Link to comment

Not a bug, and by design

 

The WebUI entry translates [IP] to the IP address of the container (which in Bridge networking mode means the host IP address), and [PORT:8080] to the host port that container port is mapped to.  Just edit the WebUI entry and manually select the IP address.  (Although I'm not quite sure why you need / want this (and mapping the port to another specific address) in the first place)

Link to comment
16 minutes ago, Squid said:

IP address of the container (which in Bridge networking mode means the host IP address), and [PORT:8080] to the host port that container port is mapped to. 

This is not necessarily true. If a host has more than 1 ethernet ports with separate IP addresses for each the docker port publishing syntax can be used to expose a port on a specific ip address. If no IP address is specified in the port mapping then the port is exposed on all interfaces. 

 

In a new setup i am trying i have the 2 ethernet ports with separate IP addresses. eth0 the primary host port on which the unRAID webui is exposed 192.168.0.44. And eth1 192.168.0.55 which the unRAID  webui is not accessible on. Custom bridge networks are setup for each interface. If I spin up a container with a port mapping of 8080:8080 and connect it to either bridge network, the container is accessible from both 192.168.0.44:8080 and 192.168.0.55:8080. If I use a port mapping of 192.168.0.55:8080:8080 then the container is only accessible via 192.168.0.55:8080 and not 192.168.0.44:8080. Additionally specifying 2 containers with 192.168.0.55:8080:8080 and 192.168.0.44:8080:8080 respectively is possible with each being accessible from the specified IP address through the matching ethernet interface.

 

I am not sure if this is a newer docker feature or if it has always been this way but it is definitely in the current version https://docs.docker.com/config/containers/container-networking/

Edited by primeval_god
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.

×
×
  • Create New...