Running eclipse-mosquitto in an Azure IoT Edge Module

I was looking to run a MQTT broker on an IoT edge device, allowing devices to communicate locally with each other. The most important thing is to modify the “Container Create Options” so that the container’s port can be seen on the local network. Also I want to use the no auth mosquitto config (it is in development), so I overrode the cmd section.

With those changes, the device was able to pull the standard docker image “eclipse-mosquitto:latest” and it started running on the local device and the exposed 1883 port was available for local devices

{
  "NetworkingConfig": {
    "EndpointsConfig": {
      "host": {}
    }
  },
  "ExposedPorts": {
    "1883/tcp": {}
  },
  "HostConfig": {
    "PortBindings": {
      "1883/tcp": [
        {
          "HostPort": "1883"
        }
      ]
    },
    "NetworkMode": "host"
  },
  "Cmd": [
    "/usr/sbin/mosquitto",
    "-c",
    "/mosquitto-no-auth.conf"
  ]
}
No comments yet.

Leave a Reply

Powered by WordPress. Designed by WooThemes