ruimarinho/mosquitto
A mosquitto docker image.
Dockerfile
links1.5.1
, 1.5
, latest
(1.5/Dockerfile)1.4.15
, 1.4
(1.4/Dockerfile)This image will be automatically updated whenever there is an update to the base image (alpine
).
from eclipse/mosquitto:
Mosquitto is an open source implementation of a server for version 3.1 and 3.1.1 of the MQTT protocol. It also includes a C and C++ client library, and the mosquitto_pub and mosquitto_sub utilities for publishing and subscribing.
from mqtt.org:
MQTT is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport. It is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium. It is also ideal for mobile applications because of its small size, low power usage, minimised data packets, and efficient distribution of information to one or many receivers.
This image contains the server binary from the mosquitto
project and client utilities such as mosquitto_pub
and mosquitto_sub
for publishing and subscribing.
❯ docker run --rm -it ruimarinho/mosquitto
By default, the mosquitto
server will run as user mosquitto
for security reasons and on the default port 1883
.
Using a custom config
The default /etc/mosquitto
is read by the mosquitto
server so you can map a host volume to customize it:
❯ docker run \
-p 1883:1883 \
-p 9001:9001 \
-v /volume1/applications/mosquitto:/etc/mosquitto \
-d \
mosquitto -c /etc/mosquitto/mosquitto.conf -v
Run a test server:
❯ docker run --rm -it \
--name mosquitto-server \
ruimarinho/mosquitto
mosquitto_sub
mosquitto_sub
is an mqtt client that subscribes to a single topic and prints all the messages it receives.
❯ docker run --rm -it \
--link mosquitto-server \
ruimarinho/mosquitto mosquitto_sub -h mosquitto-server -t '#'
mosquitto_pub
mosquitto_pub
is an mqtt client that publishes a message on a single topic and exits.
❯ docker run --rm -it \
--link mosquitto-server \
ruimarinho/mosquitto mosquitto_pub -h mosquitto-server -t home-assistant/switch/1/on -m "Switch is ON"
This image is officially supported on Docker version 1.12, with support for older versions provided on a best-effort basis.
License information for the software contained in this image.
License information for the ruimarinho/docker-mosquitto docker project.
docker pull ruimarinho/mosquitto