-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
61 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
FROM eclipse-mosquitto:latest | ||
|
||
COPY mosquitto.conf mosquitto/config/mosquitto.conf | ||
COPY passwd_file mosquitto/config/passwd_file | ||
COPY mosquitto/config/mosquitto.conf mosquitto/config/mosquitto.conf | ||
COPY mosquitto/config/passwd_file mosquitto/config/passwd_file | ||
|
||
EXPOSE 1883 9001 | ||
|
||
CMD ["mosquitto", "-p", "1883", "-c", "mosquitto/config/mosquitto.conf"] | ||
CMD ["mosquitto", "-p", "1883", "-c", "mosquitto/config/mosquitto.conf"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Mosquitto MQTT Broker | ||
|
||
## Running the broker | ||
|
||
Start by building the docker image | ||
|
||
``` | ||
docker build -t flotilla-broker . | ||
``` | ||
|
||
The broker may be started as | ||
|
||
``` | ||
docker run -it -p 1883:1883 -p 9001:9001 flotilla-broker:latest | ||
``` | ||
|
||
## Authentication | ||
|
||
The broker has been setup with a default configuration where the username and password is | ||
|
||
``` | ||
username = mosquitto | ||
password = default | ||
``` | ||
|
||
To change the password replace the [password file](./passwd_file) with a new file containing a username and password. | ||
See [this guide](https://mosquitto.org/documentation/authentication-methods/) on how to manage the password file. | ||
|
||
## Using broker locally | ||
|
||
### Installation | ||
|
||
To install the Mosquitto broker run the following commands | ||
|
||
``` | ||
sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa | ||
sudo apt-get update | ||
sudo apt-get install mosquitto | ||
sudo apt-get install mosquitto-clients | ||
``` | ||
|
||
The broker may be started with | ||
|
||
``` | ||
mosquitto -p 1883 -c mosquitto/config/mosquitto.conf | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mosquitto.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,5 @@ services: | |
build: broker | ||
ports: | ||
- '1883:1883' | ||
- '9001:9001' | ||
network_mode: host | ||
|