Skip to content

Commit 190148b

Browse files
authored
Merge pull request SensorsIot#521 from Paraphraser/20220323-mosquitto-master
20220323 mosquitto - master branch - PR 1 of 2
2 parents b3534d3 + 8c2e95b commit 190148b

File tree

3 files changed

+135
-60
lines changed

3 files changed

+135
-60
lines changed

.templates/mosquitto/Dockerfile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
# supported build argument
2+
ARG MOSQUITTO_BASE=eclipse-mosquitto:latest
3+
14
# Download base image
2-
FROM eclipse-mosquitto:latest
5+
FROM $MOSQUITTO_BASE
6+
7+
# re-reference supported argument and copy to environment var
8+
ARG MOSQUITTO_BASE
9+
ENV MOSQUITTO_BASE=${MOSQUITTO_BASE}
310

411
# see https://github.com/alpinelinux/docker-alpine/issues/98
512
RUN sed -i 's/https/http/' /etc/apk/repositories
@@ -34,4 +41,13 @@ ENV IOTSTACK_ENTRY_POINT=
3441
# IOTstack also declares these paths
3542
VOLUME ["/mosquitto/config", "/mosquitto/pwfile"]
3643

44+
# set container metadata
45+
LABEL com.github.SensorsIot.IOTstack.Dockerfile.build-args="${MOSQUITTO_BASE}"
46+
LABEL com.github.SensorsIot.IOTstack.Dockerfile.based-on="https://github.com/eclipse/mosquitto"
47+
48+
# don't need these variables in the running container
49+
ENV MOSQUITTO_BASE=
50+
ENV HEALTHCHECK_SCRIPT=
51+
ENV IOTSTACK_ENTRY_POINT=
52+
3753
# EOF

.templates/mosquitto/service.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
mosquitto:
22
container_name: mosquitto
3-
build: ./.templates/mosquitto/.
3+
build:
4+
context: ./.templates/mosquitto/.
5+
args:
6+
- MOSQUITTO_BASE=eclipse-mosquitto:latest
47
restart: unless-stopped
58
environment:
69
- TZ=Etc/UTC

0 commit comments

Comments
 (0)