Jump to content

Docker custom network container not mapping ports


guythnick
Go to solution Solved by guythnick,

Recommended Posts

I am trying to setup my new z-wave devices with zwave-js-ui container.  That is working, but I am unable to use websockets due to the port not mapping. 

 

image.thumb.png.cbe884e971922991a2589efdfd11f7f4.png

 

Below is an example of my Domoticz container, in which I have 3 mapped ports that all are showing.  And in the zwave entry, only the 8091 shows.  I can get it to map 3000if I change this to bridge mode, but I can't do that as I need this to access the MQTT container that is also on br0.

 

image.thumb.png.f4d9a565f045ceb56fee262bdb0a2c66.png

 

Also when I edit and save the container, you can see the 3000 port is in the docker run command:

 

image.png.4927786034bd0b3f554e21740869027c.png

 

 

Link to comment

That is correct.  Once you apply a custom IP address (br0) to a container, port mappings no longer take effect and are effectively meaningless since the container is running on it's own IP and nothing else would conflict, so the docker engine automatically converts those path mappings to instead be environment variables.

Link to comment
Just now, Squid said:

That is correct.  Once you apply a custom IP address (br0) to a container, port mappings no longer take effect and are effectively meaningless since the container is running on it's own IP and nothing else would conflict, so the docker engine automatically converts those path mappings to instead be environment variables.

 

Can I ask then why does the 8091 show mapped in the GUI?  Also, why in my other Domoticz container does it show all three that is also on br0?  I understand your explanation, but that port is not working to access from other containers. Only when I set the container to bridge mode does the websockets port 3000 become connectable.

Link to comment
  • Solution
41 minutes ago, Squid said:

Because 8091 is what port the container actually uses internally, and the template is set up to go to internal port 8091 when hitting the GUI.  In Bridge you can map the port to be anything else.

 

EDIT:  I changed the Home Assistant container to run on the same bridge (br0).  Apparently when set to host mode it cannot access the br0 containers. Now it connects with websockets.

 

 

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