Port Mapping


AKSnowman

Recommended Posts

Hello,

 

I apologize if this should be posted in the specific container support port. I'm pretty sure this is a general docker question though.

 

I'm going to explain a little bit about what I'm trying to do, to give some context. I'm attempting to connect my Amazon Alexa Echo Dot to Node Red and to do that I need my node red docker to listen on port 80. Well, this requires that I run node red as root user and I really would like to avoid that. I'm able to change the port that my node on node red is listening to from 80 to 1885 (can be random). When my echo dot tries to connect to my node red server it is going to reach out on port 80 so I need some mechanism to forward that port from 80 at the host to 1885 in the container.

 

Here is my docker run command

run -d --name='nodered' --net='br0' --ip='192.168.50.12' --log-opt max-size='50m' --log-opt max-file='1' --privileged=true -e TZ="America/Anchorage" -e HOST_OS="Unraid" -e 'TCP_PORT_1880'='1880' -v '/mnt/user/docker/appdata/nodered':'/data':'rw' --publish 80:1885 'nodered/node-red-docker:v8'

 

To do this, I assumed docker port forwarding would be my solution. On my Container configuration page I've add the following to extra parameters

-p 80:1885

and restart the docker container. When the docker page refreshes this is what is now showing in my port mappings (port 1880 is the port for the node red ui). 

192.168.50.12:1880/TCP <-> 192.168.50.12:1880
192.168.50.12:1885/TCP <-> 192.168.50.12:1885

This stand out to me right away as being incorrect, shouldn't it show 1885/TCP <-> 80/TCP?

 

When I navigate to 192.168.50.12:1885/description.xml I'm served with the contents that I'm expecting to be served at 192.168.50.12:80. 

 

When I run the command 

docker port nodered

I don't see any results...should I expect to see my port mapping here? (again, I'm a novice and don't even know where to begin with this). 

 

When I run the command 

docker inspect nodered

there is a block under  HostConfig that shows the following (which seems correct to me?)

"PortBindings": {
                "1885/tcp": [
                    {
                        "HostIp": "",
                        "HostPort": "80"
                    }
                ]
            },

 

I'm not sure if this is an unraid issue or a docker issue or a docker container issue so I'm being jerked around all over the place trying to solve this on my own, I'm not sure where I should focus my attentions. Any help would be greatly appreciated.

 

Thank you

Edited by AKSnowman
Added docker run command.
Link to comment
  • 3 months later...
  • 2 months later...
  • 1 month later...

I'm going to revive this thread as there is a similar amazon node that i would like to install.

BUT, in order to do so, it requires node-red to be running on the host network, for alexa to be listening on Port 80

 

Since i have my dockers on br0 with individual assigned IP's, is there anyway to have br0 listen to port 80 on the host network?

 

This is my run cmd

1833987453_dockerruncmd.thumb.png.d35b57f7a279443d7cf032074c73021b.png

 

Thanks

Link to comment
  • 7 months later...

i would like to know the answer to this too

On 6/11/2020 at 9:41 AM, bdydrp said:

I'm going to revive this thread as there is a similar amazon node that i would like to install.

BUT, in order to do so, it requires node-red to be running on the host network, for alexa to be listening on Port 80

 

Since i have my dockers on br0 with individual assigned IP's, is there anyway to have br0 listen to port 80 on the host network?

 

This is my run cmd

1833987453_dockerruncmd.thumb.png.d35b57f7a279443d7cf032074c73021b.png

 

Thanks

 

Link to comment
  • 1 year later...

did anyone solve this....

Basically Im moving from smarththings to home assistant.  There is only one thing left for me to do with Home Assistant before I throw away smartthings!

That's issue a voice command to instruct HA to do something.

 

I dont want to pay the monthly subscription to use allow HA to work with amazon, I want to keep things local rather than via the cloud.

There are several palettes in node-red, but they require you to listen on port 80, and I cant work out how to listen on port 80.

Can someone give an indication on how this would work on node-red.

 

Thanks

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.