

To test the setup of the running Mosquitto container, I used my original software, still available on github. Testing the eclipse-mosquitto Docker container Using the -name directive also allows the container to be stopped and restarted, using: % docker stop mosquitto Alternatively, we could map that onto another localhost port if it clashed with a locally running MQTT broker, e.g. The -p 1883:1883 argument maps the docker container’s default MQTT socket 1883 the localhost ( 127.0.0.1) port 1883. Run the basic Docker image with default settings: % docker run -it -name mosquitto -p 1883:1883 eclipse-mosquittoġ582194844: mosquitto version 1.6.8 startingġ582194844: Config loaded from /mosquitto/config/nf.ġ582194844: Opening ipv4 listen socket on port 1883.ġ582194844: Opening ipv6 listen socket on port 1883. Note of caution: the instructions on the Dockerhub site are incorrect! Run the docker image I’m assuming you have Docker installed and configured for your local working environment.įirst, pull the latest image from Dockerhub: % docker pull eclipse-mosquitto

Run the docker image with a mounted volumeĮclipse-mosquitto Docker image Pull the latest image.Testing the eclipse-mosquitto Docker container.Rather than, as in the previous Docker blog articles, build our own Docker image containing Mosquitto, we can use the official Dockerhub image. Running Mosquitto in a Docker container is, therefore, a perfect test environment. Still, one of the significant benefits of Docker is not polluting your working machine with lots of different tools.
ECLIPSE DOCKER SETUP LOCAL KITEMATIC MAC
Mosquitto can be installed natively on Windows, Mac and Linux. We have, also, extensively covered Docker in previous blog posts.įor another internal dogfood project, I wanted to run a local MQTT Broker rather than a web-based broker, such as. Mosquitto is now part of the Eclipse Foundation, and an project, sponsored by .Īnother area that has grown during the interim period is the use of container technology, such as Docker, for both testing and deployment. Back in 2010, the first open-source MQTT Broker was Mosquitto.

Subsequently, MQTT has grown to be one of the most widely used IoT connectivity protocols with direct support from service such as AWS. I first wrote about MQTT and IoT back in 2012, when I developed a simple C based library to publish and subscribe Quality of Service (QoS) level 0 MQTT messages.
