An MQTT broker with no security. So any MQTT client can connect to this MQTT broker for publishing MQTT messages and subscribing to MQTT messages.
This MQTT broker is listening to port 1883 and websocket port 8080
It is also possible to specify environment variables in the configuration file as specified in next section.
Instead of using configuration file:
/mosquitto/config/mosquitto.confyou can also use the following configuration file that supports environment variables.
/mosquitto/config/mosquitto.conf.envSo when this file is specified then at startup of the container it will first create a /mosquitto/config/mosquitto.conf by substituting all environment variables in this file having the format ($ENV_VARIABLE or ${ENV_VARIABLE}) by using the command envsubst
Note that is based on the docker hub image eclipse-mosquitto (github repository eclipse/mosquitto)
version: "3.9"
services:
mqtt:
image: janvda/eclipse-mosquitto:2.1.0
ports:
# following line exposes port 1883 (=the port of the MQTT broker) to host port 8101
- "8101:1883"
# following line exposes websocket port 8080 (=the websocket port of the MQTT broker) to host port 8102
- "8102:8080"
eclipse-mosquitto:2.0.18 and supports `/mosquitto/config/mosquitto.conf.env`` containing environment variablesContent type
Image
Digest
sha256:3f501d876…
Size
7.9 MB
Last updated
over 2 years ago
docker pull janvda/eclipse-mosquitto:2.1.0