Docker Port Mapping

I'm new to docker, and trying to install Nod-Red in docker using port mapping. Any ideas what I am dowing wrong. The following as expected:

docker run –restart=unless-stopped -it -p 1880:1880 -v /home/pi/node-red-01:/data --name node-red-01 nodered/node-red:latest

But when changing the port mapping, the connection to the web gui fails:

docker run –restart=unless-stopped -it -p 1880:1881 -v /home/pi/node-red-01:/data --name node-red-01 nodered/node-red:latest

Far from a docker export, but I think your second one is saying when a connection comes to 1880 on the host send to 1881 on the container. Assuming you have NR on default 1880 then you are trying to connect to a port without anything listening.

Pretending you are connecting to xyz:1880/ and it works, then you could change your mapping to be 1881:1880 and then xyz:1881/ should work as you would connect to the host port 1881 which would then look to the container as if you were connecting to port 1880.

Thank you. I was staring at the command line too long yesterday

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.