-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
33 lines (24 loc) · 1.25 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#
# Dockerfile to create container with modified mosquitto broker executable.
#
FROM debian:stretch
LABEL Maintainer="[email protected]"
LABEL Description="This image is used to start a modified mosquitto executable with HICAP interface. It logs all incoming MQTT publish messages and their connection metadata to a remote logstash service for further processing."
# Install libraries required by modified mosquitto executable.
# File libuuid.so is already present in Debian Stretch.
RUN apt-get update && apt-get install -y \
libssl1.1 \
libuv1 \
libjansson4
RUN mkdir /mosquitto
RUN useradd --no-create-home --shell /usr/sbin/nologin --user-group mosquitto
COPY docker-entrypoint.sh mosquitto mosquitto.conf mosquitto_passwd /mosquitto/
RUN chown -R mosquitto:mosquitto /mosquitto
RUN chmod +x /mosquitto/mosquitto /mosquitto/docker-entrypoint.sh
CMD [ "/mosquitto/mosquitto", "-c", "/mosquitto/mosquitto.conf" ]
ENTRYPOINT [ "/mosquitto/docker-entrypoint.sh" ]
# TCP/IP port 1883 is reserved by IANA for use with MQTT.
# TCP/IP port 8883 is also registered, for using MQTT over SSL.
# TCP/IP port 443 is for HTTPS and thus usually open in any firewall.
# Note: Only the port configured in /mosquitto/mosquitto.conf is served.
EXPOSE 443/tcp 1883 8883