An MQTT Docker publisher for the BigBoat ecosystem.
MQTT Docker publisher publishes data from the Docker API to an MQTT Server. Currently the following topics are published:
- /info (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#/display-system-wide-information)
- /event (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#/monitor-docker-s-events)
- /container/info (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#/inspect-a-container)
- /container/stats (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#/get-container-stats-based-on-resource-usage)
Each topic is preceded by the value of MQTT_TOPIC_NS. This namespace mechanism allows multiple publishers to use the same mqtt server.
docker run \
-e DOCKER_HOST=tcp://dockerhost:2375 \
-e MQTT_URL=mqtt://mqttserver \
-e MQTT_TOPIC_NS=/docker \
--name docker-publisher
ictu/bigboat-docker-publisher
If you want to contribute please fork the repo and submit a pull request in order to get your changes merged into the main branch.
Below you find an example of how to run the agent for development.
#!/bin/bash
DOCKER_HOST=tcp://dockerhost:2375 \
MQTT_URL=mqtt://mqttserver \
MQTT_TOPIC_NS=/docker \
nodemon index.coffee