Public | Automated Build

Last pushed: 10 months ago
Short Description
EMQTT Automated Build
Full Description

This image is designed for Rancher private container service.

You can write a docker-compose.yml and provide MYSQL_HOST, MYSQL_DB, MYSQL_USER, MYSQL_PASS as environment variables, if these environment variables are provided, the container will load the emqttd_plugin_mysql as default authentication of the broker.

emqttd-loadbalancer:
  image: rancher/load-balancer-service
  ports:
    - 1883:1883/tcp
    - 8083:8083/tcp
    - 8883:8883/tcp
    - 18083:18083
  links:
    - emqttd-main-broker:emqttd-main-broker
    - emqttd-broker:emqttd-broker
  labels:
    io.rancher.scheduler.affinity:host_label: loadbalancer=true
    io.rancher.container.network: true

emqttd-main-broker:
  image: oring/emqttd:latest
  hostname: emqttd-main-broker
  ports:
    - 1883
    - 8083
    - 8883
    - 18083
    - 4369
  expose:
    - 1883
    - 8083
    - 8883
    - 18083
    - 4369
  environment:
    - MYSQL_HOST=YOUR_MYSQL_HOST
    - MYSQL_DB=YOUR_MYSQL_DB
    - MYSQL_USER=YOUR_MYSQL_USER
    - MYSQL_PASS=YOUR_MYSQL_PASS
  labels:
    io.rancher.container.pull_image: always
    io.rancher.container.requested_ip: 10.42.30.67
    io.rancher.container.network: true

emqttd-broker:
  image: oring/emqttd:latest
  ports: 
    - 1883
    - 8083
    - 8883
    - 18083
    - 4369
  expose:
    - 1883
    - 8083
    - 8883
    - 18083
    - 4369
  environment:
    - MYSQL_HOST=YOUR_MYSQL_HOST
    - MYSQL_DB=YOUR_MYSQL_DB
    - MYSQL_USER=YOUR_MYSQL_USER
    - MYSQL_PASS=YOUR_MYSQL_PASS
  links:
    - emqttd-main-broker:emqttd-main-broker
  extra_hosts:
    - "emqttd-main-broker:10.42.30.67"
  labels:
    io.rancher.container.pull_image: always
    io.rancher.container.network: true

emqttd-main-broker is used for cluster join purpose, each emqttd-broker container will look for the extra_hosts ip setting and try to join the cluster,
so if you want to enable cluster feature, you should at least run one emqttd-main-broker and request a fix ip by io.rancher.container.requested_ip tag, and set emqttd-broker extra_hosts to this ip.

Docker Pull Command
Owner
oring
Source Repository

Comments (0)