mosquitto on docker
Posted sunnykwan
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mosquitto on docker相关的知识,希望对你有一定的参考价值。
1.
docker pull eclipse-mosquitto
2.
mkdir
-p /mosquitto/config
mkdir
-p /mosquitto/data
mkdir
-p /mosquitto/log
3.
vi /mosquitto/config/mosquitto.conf
context:
persistence true
persistence_location /mosquitto/data
log_dest file /mosquitto/log/mosquitto.log
4.
chmod
-R 755 /mosquitto
chmod
-R 777 /mosquitto/log
5.
docker run -d --name=mosquitto --privileged
-p 1883:1883 -p 9001:9001
-v /mosquitto/config/mosquitto.conf:/mosquitto/config/mosquitto.conf
-v /mosquitto/data:/mosquitto/data
-v /mosquitto/log:/mosquitto/log
eclipse-mosquitto
以上是关于mosquitto on docker的主要内容,如果未能解决你的问题,请参考以下文章
eclipse-mosquitto 中的 docker exec 错误
sh docker-compose-mqtt-mosquitto-websocket-clients.sh
通过端口 443 和 apache 访问 mosquitto
9001是啥默认端口,启动docker run -it --name=mosquitto --privileged -p 1883:1883 -p 9001:9001?