|
1 |
| -https://github.com/eclipse/mosquitto |
2 |
| - |
3 |
| -``` |
4 |
| -docker run -d \ |
5 |
| ---name=mosquitto \ |
6 |
| --p 1883:1883 \ |
7 |
| --p 9001:9001 \ |
8 |
| --v /storage/mosquitto/config:/mosquitto/config \ |
9 |
| --v /storage/mosquitto/data:/mosquitto/data \ |
10 |
| --v /storage/mosquitto/log:/mosquitto/log \ |
11 |
| ---restart=always \ |
12 |
| -zarusz/mosquitto:arm64 |
13 |
| -``` |
14 |
| - |
15 |
| -/storage/mosquitto/config/mosquitto.conf |
16 |
| -``` |
17 |
| -persistence true |
18 |
| -persistence_location /mosquitto/data/ |
19 |
| -
|
20 |
| -log_dest file /mosquitto/log/mosquitto.log |
21 |
| -``` |
22 |
| - |
23 |
| -#Eclipse Mosquitto v1.4.10 Docker Image |
24 |
| - |
25 |
| -##Mount Points |
26 |
| - |
27 |
| -Three mount points have been created in the image to be used for configuration, persistent storage and logs. |
28 |
| -``` |
29 |
| -/mosquitto/config |
30 |
| -/mosquitto/data |
31 |
| -/mosquitto/log |
32 |
| -``` |
33 |
| - |
34 |
| - |
35 |
| -##Configuration |
36 |
| - |
37 |
| -When running the image, the default configuration values are used. |
38 |
| -To use a custom configuration file, mount a **local** configuration file to `/mosquitto/config/mosquitto.conf` |
39 |
| -``` |
40 |
| -docker run -it -p 1883:1883 -p 9001:9001 -v <path-to-configuration-file>:/mosquitto/config/mosquitto.conf mosquitto:1.4.10 |
41 |
| -``` |
42 |
| - |
43 |
| -Configuration can be changed to: |
44 |
| - |
45 |
| -* persist data to `/mosquitto/data` |
46 |
| -* log to `/mosquitto/log/mosquitto.log` |
47 |
| - |
48 |
| -i.e. add the following to `mosquitto.conf`: |
49 |
| -``` |
50 |
| -persistence true |
51 |
| -persistence_location /mosquitto/data/ |
52 |
| -
|
53 |
| -log_dest file /mosquitto/log/mosquitto.log |
54 |
| -``` |
55 |
| - |
56 |
| -**Note**: If a volume is used, the data will persist between containers. |
57 |
| - |
58 |
| -##Build |
59 |
| -Build the image: |
60 |
| -``` |
61 |
| -docker build -t mosquitto:1.4.10 . |
62 |
| -``` |
63 |
| - |
64 |
| -##Run |
65 |
| -Run a container using the new image: |
66 |
| -``` |
67 |
| -docker run -it -p 1883:1883 -p 9001:9001 -v <path-to-configuration-file>:/mosquitto/config/mosquitto.conf -v /mosquitto/data -v /mosquitto/log mosquitto:1.4.10 |
68 |
| -``` |
69 |
| -:boom: if the mosquitto configuration (mosquitto.conf) was modified |
70 |
| -to use non-default ports, the docker run command will need to be updated |
71 |
| -to expose the ports that have been configured. |
| 1 | +https://github.com/eclipse/mosquitto |
| 2 | + |
| 3 | +``` |
| 4 | +docker run -d \ |
| 5 | +--name=mosquitto \ |
| 6 | +-p 1883:1883 \ |
| 7 | +-p 9001:9001 \ |
| 8 | +-v /storage/mosquitto/config:/mosquitto/config \ |
| 9 | +-v /storage/mosquitto/data:/mosquitto/data \ |
| 10 | +-v /storage/mosquitto/log:/mosquitto/log \ |
| 11 | +--restart=always \ |
| 12 | +zarusz/mosquitto:arm64 |
| 13 | +``` |
| 14 | + |
| 15 | +/storage/mosquitto/config/mosquitto.conf |
| 16 | +``` |
| 17 | +persistence true |
| 18 | +persistence_location /mosquitto/data/ |
| 19 | +
|
| 20 | +log_dest file /mosquitto/log/mosquitto.log |
| 21 | +``` |
| 22 | + |
| 23 | +#Eclipse Mosquitto v1.4.10 Docker Image |
| 24 | + |
| 25 | +##Mount Points |
| 26 | + |
| 27 | +Three mount points have been created in the image to be used for configuration, persistent storage and logs. |
| 28 | +``` |
| 29 | +/mosquitto/config |
| 30 | +/mosquitto/data |
| 31 | +/mosquitto/log |
| 32 | +``` |
| 33 | + |
| 34 | + |
| 35 | +##Configuration |
| 36 | + |
| 37 | +When running the image, the default configuration values are used. |
| 38 | +To use a custom configuration file, mount a **local** configuration file to `/mosquitto/config/mosquitto.conf` |
| 39 | +``` |
| 40 | +docker run -it -p 1883:1883 -p 9001:9001 -v <path-to-configuration-file>:/mosquitto/config/mosquitto.conf mosquitto:1.4.10 |
| 41 | +``` |
| 42 | + |
| 43 | +Configuration can be changed to: |
| 44 | + |
| 45 | +* persist data to `/mosquitto/data` |
| 46 | +* log to `/mosquitto/log/mosquitto.log` |
| 47 | + |
| 48 | +i.e. add the following to `mosquitto.conf`: |
| 49 | +``` |
| 50 | +persistence true |
| 51 | +persistence_location /mosquitto/data/ |
| 52 | +
|
| 53 | +log_dest file /mosquitto/log/mosquitto.log |
| 54 | +``` |
| 55 | + |
| 56 | +**Note**: If a volume is used, the data will persist between containers. |
| 57 | + |
| 58 | +##Build |
| 59 | +Build the image: |
| 60 | +``` |
| 61 | +docker build -t mosquitto:1.4.10 . |
| 62 | +``` |
| 63 | + |
| 64 | +##Run |
| 65 | +Run a container using the new image: |
| 66 | +``` |
| 67 | +docker run -it -p 1883:1883 -p 9001:9001 -v <path-to-configuration-file>:/mosquitto/config/mosquitto.conf -v /mosquitto/data -v /mosquitto/log mosquitto:1.4.10 |
| 68 | +``` |
| 69 | +:boom: if the mosquitto configuration (mosquitto.conf) was modified |
| 70 | +to use non-default ports, the docker run command will need to be updated |
| 71 | +to expose the ports that have been configured. |
0 commit comments