diff --git a/apps/mosquitto-prometheus-exporter/Dockerfile b/apps/mosquitto-prometheus-exporter/Dockerfile index 6d53da6..a6df893 100644 --- a/apps/mosquitto-prometheus-exporter/Dockerfile +++ b/apps/mosquitto-prometheus-exporter/Dockerfile @@ -1,12 +1,18 @@ -FROM cr.wks/debian-golang +FROM cr.wks/debian-golang AS build ENV GOARCH=arm64 ENV GOPATH=/usr/src/gopath ENV GOCACHE=/usr/src/gocache RUN go env -RUN cat /etc/os-release WORKDIR /usr/src -RUN go get github.com/sapcc/mosquitto-exporter -RUN go mode download -RUN make -j4 build CGO_ENABLED=0 -RUN ls -al \ No newline at end of file +RUN go install github.com/sapcc/mosquitto-exporter@latest +#RUN go mod download + +FROM scratch +LABEL source_repository="https://github.com/sapcc/mosquitto-exporter" + +COPY --from=build /usr/src/gopath/bin/mosquitto-exporter /mosquitto-exporter + +EXPOSE 9234 + +ENTRYPOINT [ "/mosquitto-exporter" ] \ No newline at end of file