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