Jump to content
AKSnowman

Port Mapping

3 posts in this topic Last Reply

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.

Share this post


Link to post

Post your docker run command as explained in the very first link in the Docker FAQ pinned near the top of this same subforum. 

Share this post


Link to post

I'm so sorry. For some reason when I looked at the FAQ for this exact thing (posting rules) I somehow skipping the first link.

Share this post


Link to post

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.