Debian Codegraph @

docker/1.6-openssl/Dockerfile

raw
1 FROM alpine:3.23
2
3 ENV VERSION=1.6.15 \
4 DOWNLOAD_SHA256=5ff2271512f745bf1a451072cd3768a5daed71e90c5179fae12b049d6c02aa0f \
5 GPG_KEYS=A0D6EEA1DCAE49A635A3B2F0779B22DFB3E717B7
6
7 LABEL \
8 org.opencontainers.image.authors="Roger Light <[email protected]>" \
9 org.opencontainers.image.title="eclipse-mosquitto" \
10 org.opencontainers.image.description="Eclipse Mosquitto MQTT Broker" \
11 org.opencontainers.image.url="https://mosquitto.org/" \
12 org.opencontainers.image.documentation="https://mosquitto.org/documentation/" \
13 org.opencontainers.image.source="https://github.com/eclipse-mosquitto/mosquitto" \
14 org.opencontainers.image.licenses="EPL-2.0 OR BSD-3-Clause" \
15 org.opencontainers.image.version=${VERSION}
16
17 RUN set -x && \
18 apk --no-cache add --virtual build-deps \
19 build-base \
20 cmake \
21 gnupg \
22 libwebsockets-dev \
23 linux-headers \
24 openssl-dev \
25 util-linux-dev && \
26 wget https://mosquitto.org/files/source/mosquitto-${VERSION}.tar.gz -O /tmp/mosq.tar.gz && \
27 echo "$DOWNLOAD_SHA256 /tmp/mosq.tar.gz" | sha256sum -c - && \
28 wget https://mosquitto.org/files/source/mosquitto-${VERSION}.tar.gz.asc -O /tmp/mosq.tar.gz.asc && \
29 export GNUPGHOME="$(mktemp -d)" && \
30 found=''; \
31 for server in \
32 hkps://keys.openpgp.org \
33 hkp://keyserver.ubuntu.com:80 \
34 pgp.mit.edu \
35 ; do \
36 echo "Fetching GPG key $GPG_KEYS from $server"; \
37 gpg --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$GPG_KEYS" && found=yes && break; \
38 done; \
39 test -z "$found" && echo >&2 "error: failed to fetch GPG key $GPG_KEYS" && exit 1; \
40 gpg --batch --verify /tmp/mosq.tar.gz.asc /tmp/mosq.tar.gz && \
41 gpgconf --kill all && \
42 rm -rf "$GNUPGHOME" /tmp/mosq.tar.gz.asc && \
43 mkdir -p /build/mosq && \
44 tar --strip=1 -xf /tmp/mosq.tar.gz -C /build/mosq && \
45 rm /tmp/mosq.tar.gz && \
46 make -C /build/mosq -j "$(nproc)" \
47 CFLAGS="-Wall -O2" \
48 WITH_ADNS=no \
49 WITH_DOCS=no \
50 WITH_SHARED_LIBRARIES=yes \
51 WITH_SRV=no \
52 WITH_STRIP=yes \
53 WITH_WEBSOCKETS=yes \
54 prefix=/usr \
55 binary && \
56 addgroup -S -g 1883 mosquitto 2>/dev/null && \
57 adduser -S -u 1883 -D -H -h /var/empty -s /sbin/nologin -G mosquitto -g mosquitto mosquitto 2>/dev/null && \
58 mkdir -p /mosquitto/config /mosquitto/data /mosquitto/log && \
59 install -d /usr/sbin/ && \
60 install -s -m755 /build/mosq/client/mosquitto_pub /usr/bin/mosquitto_pub && \
61 install -s -m755 /build/mosq/client/mosquitto_rr /usr/bin/mosquitto_rr && \
62 install -s -m755 /build/mosq/client/mosquitto_sub /usr/bin/mosquitto_sub && \
63 install -s -m644 /build/mosq/lib/libmosquitto.so.1 /usr/lib/libmosquitto.so.1 && \
64 install -s -m755 /build/mosq/src/mosquitto /usr/sbin/mosquitto && \
65 install -s -m755 /build/mosq/src/mosquitto_passwd /usr/bin/mosquitto_passwd && \
66 install -m644 /build/mosq/mosquitto.conf /mosquitto/config/mosquitto.conf && \
67 install -Dm644 /build/mosq/epl-v10 /usr/share/licenses/mosquitto/epl-v10 && \
68 install -Dm644 /build/mosq/edl-v10 /usr/share/licenses/mosquitto/edl-v10 && \
69 chown -R mosquitto:mosquitto /mosquitto && \
70 apk --no-cache add \
71 ca-certificates \
72 libwebsockets \
73 tzdata && \
74 apk del build-deps && \
75 rm -rf /build
76
77 VOLUME ["/mosquitto/data", "/mosquitto/log"]
78
79 # Set up the entry point script and default command
80 COPY docker-entrypoint.sh /
81 EXPOSE 1883
82 ENTRYPOINT ["/docker-entrypoint.sh"]
83 CMD ["/usr/sbin/mosquitto", "-c", "/mosquitto/config/mosquitto.conf"]