Skip to content

Lightweight MQTT broker for Raspberry Pi based on Arm Alpine Linux.

License

Notifications You must be signed in to change notification settings

Aquillum/rpi-mosquitto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rpi-mosquitto

Build Status This image on DockerHub

Docker image for Mosquitto. A lightweight MQTT broker for Raspberry Pi based on Arm Alpine Linux. Inspired by https://github.com/toke/docker-mosquitto

Run

docker run -ti -p 1883:1883 -p 9001:9001 raymondmm/rpi-mosquitto

Exposes Port 1883 (MQTT) 9001 (Websocket MQTT)

Running with persistence

Local directories / External Configuration

Alternatively you can use a volume to make the changes persistent and change the configuration.

mkdir -p /srv/mosquitto/config/
mkdir -p /srv/mosquitto/data/
mkdir -p /srv/mosquitto/log/
# place your mosquitto.conf in /srv/mosquitto/config/
# NOTE: You have to change the permissions of the directories
# to allow the user to read/write to data and log and read from
# config directory
# For TESTING purposes you can use chmod -R 777 /srv/mosquitto/*
# Better use "-u" with a valid user id on your docker host

# Copy the files from the config directory of this project
# into /src/mosquitto/config. Change them as needed for your
# particular needs.

docker run -ti -p 1883:1883 -p 9001:9001 \
-v /srv/mosquitto:/mosquitto \
--name mosquitto raymondmm/mosquitto

Volumes: /mosquitto

Docker Volumes for persistence

Using Docker Volumes for persistence.

Create a named volume:

docker volume create --name mosquitto_data

Now it can be attached to docker by using -v mosquitto_data:/mosquitto in the Example above. Be aware that the permissions within the volumes are most likely too restrictive.

Local time and time zone

Bind host /etc/localtime and /etc/timezone with the container too sync time and time zone:

docker volume create ... -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/TZ:ro ...

About

Lightweight MQTT broker for Raspberry Pi based on Arm Alpine Linux.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published