node-red / node-red/node-red.github.io

Linking containers example not working any more

未關閉
#207 6 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
JavaScript
星號
118
分支
161
平均合併
8 小時 18 分鐘
30 天內合併 PR
4

描述

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:

  1. using the command like above with the last 1.6 Mosquitto
  2. Providing an docker image with adapted mosquitto.conf file to enable listener 1883 and allow_anonymous true to 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.conf

VOLUME ["/mosquitto/data", "/mosquitto/log"]

EXPOSE 1883
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/usr/sbin/mosquitto", "-c", "/mosquitto/config/mosquitto.conf"]

Best Christian

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 Docker 入門文件中的「linking containers」部分開始,使用目前的映像重現其中的 Mosquitto 範例。將結果與 Mosquitto 1.6.13 以及回報的 listener 設定進行比較。當文件中的範例能在受支援的 Mosquitto 版本上運作,並且明確包含任何必要的設定或版本固定時,即視為完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
docker
領域
devops, documentation
Issue 類型
文件
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。