Docker Official Images – Eclipse Mosquitto is an open source message broker which implements MQTT version 5, 3.1.1 and 3.1

# docker pull eclipse-mosquitto

When running the image the default configuration values are used  to use a custom configuration file mount a local configuration file to /mosquitto/config/mosquitto.conf

# docker run -it -p 1883:1883 -p 9001:9001 -v mosquitto.conf:/mosquitto/config/mosquitto.conf eclipse-mosquitto

Configuration can be changed to

persist data to /mosquitto/data
log to /mosquitto/log/mosquitto.log

i.e. add the following to mosquitto.conf

persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log

Leave a Reply

You must be logged in to post a comment.