1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-12-23 01:39:27 +02:00

update mosquitto

This commit is contained in:
kev 2021-11-15 13:37:03 +08:00
parent 2a8dbb280e
commit 97bc6ddca0
11 changed files with 47 additions and 43 deletions

View File

@ -2,8 +2,8 @@
# Dockerfile for mosquitto
#
FROM alpine
MAINTAINER kev <noreply@easypi.pro>
FROM alpine:3
MAINTAINER EasyPi Software Foundation
RUN apk add --no-cache ca-certificates mosquitto

View File

@ -4,33 +4,35 @@ mosquitto
![](https://badge.imagelayers.io/vimagick/mosquitto:latest.svg)
[Mosquitto][1] is an open source (BSD licensed) message broker that implements
the MQ Telemetry Transport protocol versions 3.1 and 3.1.1.
the MQTT protocol versions 3.1 and 3.1.1.
## docker-compose.yml
```yaml
mosquitto:
image: vimagick/mosquitto
ports:
- "1883:1883"
- "8080:8080"
- "8883:8883"
volumes:
- ./data/mosquitto.conf:/etc/mosquitto/mosquitto.conf
- ./data/pwfile:/etc/mosquitto/pwfile
- ./data:/var/lib/mosquitto
restart: always
version: "3.8"
services:
mosquitto:
image: vimagick/mosquitto
ports:
- "1883:1883"
volumes:
- ./data/etc:/etc/mosquitto
- ./data/var:/var/lib/mosquitto
restart: unless-stopped
```
## mosquitto.conf
```ini
port 1883
listener 1883
log_dest stdout
allow_anonymous false
password_file /etc/mosquitto/pwfile
persistence true
persistence_location /var/lib/mosquitto
persistence_file mosquitto.db
#plugin /usr/lib/mosquitto_dynamic_security.so
#plugin_opt_config_file /etc/mosquitto/dynamic-security.json
###### ENABLE TLS ######
listener 8883
@ -51,9 +53,10 @@ require_certificate false
## server
```bash
$ mkdir -m 777 data
$ touch data/mosquitto.conf data/pwfile
$ vi data/mosquitto.conf
$ mkdir -p data/{etc,var}
$ chmod -R 777 data
$ touch data/etc/mosquitto.conf data/etc/pwfile
$ vi data/etc/mosquitto.conf
$ docker-compose up -d
$ docker-compose exec mosquitto sh
>>> cd /etc/mosquitto

View File

@ -2,7 +2,7 @@
# Dockerfile for mosquitto-arm
#
FROM easypi/alpine-arm
FROM alpine:3
MAINTAINER EasyPi Software Foundation
RUN apk add --no-cache ca-certificates mosquitto

View File

@ -1,11 +1,10 @@
mosquitto:
image: easypi/mosquitto-arm
ports:
- "1883:1883"
- "8080:8080"
- "8883:8883"
volumes:
- ./data/mosquitto.conf:/etc/mosquitto/mosquitto.conf
- ./data/pwfile:/etc/mosquitto/pwfile
- ./data:/var/lib/mosquitto
restart: always
version: "3.8"
services:
mosquitto:
image: easypi/mosquitto-arm64
ports:
- "1883:1883"
volumes:
- ./data/etc:/etc/mosquitto
- ./data/var:/var/lib/mosquitto
restart: unless-stopped

View File

@ -2,12 +2,15 @@
# Docs: https://mosquitto.org/man/mosquitto-conf-5.html
#
port 1883
listener 1883
log_dest stdout
allow_anonymous false
password_file /etc/mosquitto/pwfile
persistence true
persistence_location /var/lib/mosquitto/
persistence_location /var/lib/mosquitto
persistence_file mosquitto.db
#plugin /usr/lib/mosquitto_dynamic_security.so
#plugin_opt_config_file /etc/mosquitto/dynamic-security.json
###### ENABLE WS ######
#listener 8080

View File

View File

@ -1,11 +1,10 @@
mosquitto:
image: vimagick/mosquitto
ports:
- "1883:1883"
- "8080:8080"
- "8883:8883"
volumes:
- ./data/mosquitto.conf:/etc/mosquitto/mosquitto.conf
- ./data/pwfile:/etc/mosquitto/pwfile
- ./data:/var/lib/mosquitto
restart: always
version: "3.8"
services:
mosquitto:
image: vimagick/mosquitto
ports:
- "1883:1883"
volumes:
- ./data/etc:/etc/mosquitto
- ./data/var:/var/lib/mosquitto
restart: unless-stopped