Dockerized node-red


I have created a new node where it connects to Mosquitto (local MQTT broker) on port 1883. Everything is fine with node-red running outside the docker, but a dockerized node-red, will not able to establish the MQTT connection.

The first idea is to export the port -p 1883:1883, but it fails and returns the port is already in use.(sudo service mosquitto start)

The second idea is to run mosquitto as a container and establish the link between both, but it reports also. the MQTT connection is not established.
1/ sudo service mosquitto stop
2/ docker run -it -p 1883:1883 -p 9001:9001 --name mosquitto eclipse-mosquitto
3/ docker run -it -u root -p 1880:1880 -v ~/docker/nodered:/data --link mosquitto:broker --name myName image-based-on-node-red:1

Thanks for any help.

Any help

That's fundamentally how I have it configured. How are you defining the Mosquitto connection from NR?

I have found the root cause,
The URL of MQTT in was, which works fine for non dockerized NR. But I need to set that URL to for NR container.