node-red / node-red/node-red.github.io
Linking containers example not working any more
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 118
- Forks
- 161
- Avg merge
- 8h 18m
- Merged PRs (30d)
- 4
Description
In the section about linking containers the example to link mosquitto by a bridge network dosn't work with mosquitto:latest (2.0.7), but with the last 1.6.13 seams that the config file of Mosquitto 2 is different and not listening to the network by default.
If I look into the container log I get:
1614083867: mosquitto version 2.0.7 starting
1614083867: Config loaded from /mosquitto/config/mosquitto.conf.
1614083867: Starting in local only mode. Connections will only be possible from clients running on this machine.
1614083867: Create a configuration file which defines a listener to allow remote access.
1614083867: Opening ipv4 listen socket on port 1883.
1614083867: Opening ipv6 listen socket on port 1883.
1614083867: Error: Address not available
1614083867: mosquitto version 2.0.7 running
by altering the docker command to:
docker run -itd --network iot --name mybroker eclipse-mosquitto:1.6.13
it works like expected. So two solutions:
- using the command like above with the last 1.6 Mosquitto
- Providing an docker image with adapted mosquitto.conf file to enable
listener 1883andallow_anonymous trueto have the same behavior for the latest mosquitto.
Dockerfile could look like:
FROM eclipse-mosquitto:latest
RUN echo "listener 1883" >> /mosquitto/config/mosquitto.conf
&& echo "allow_anonymous true" >> /mosquitto/config/mosquitto.confVOLUME ["/mosquitto/data", "/mosquitto/log"]
EXPOSE 1883
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/usr/sbin/mosquitto", "-c", "/mosquitto/config/mosquitto.conf"]
Best Christian
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the “linking containers” section in the Docker getting-started documentation and reproduce its Mosquitto example using the current image. Compare the result with Mosquitto 1.6.13 and the reported listener configuration. Done means the documented example works with the supported Mosquitto version and clearly includes any required configuration or version pinning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker
- Domain
- devops, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100