-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
29 lines (20 loc) · 944 Bytes
/
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
FROM golang:1.23.4-alpine3.21 AS builder
RUN apk --update add ca-certificates make git
RUN echo 'tibber:*:65532:' > /tmp/group && \
echo 'tibber:*:65532:65532:tibber:/:/tibber-exporter' > /tmp/passwd
WORKDIR /workspace
COPY . /workspace
RUN make build
FROM scratch
LABEL org.opencontainers.image.title="tibber-exporter" \
org.opencontainers.image.description="Prometheus exporter for Tibber power usage and costs" \
org.opencontainers.image.authors="Terje Sannum <[email protected]>" \
org.opencontainers.image.url="https://github.com/terjesannum/tibber-exporter" \
org.opencontainers.image.source="https://github.com/terjesannum/tibber-exporter"
WORKDIR /
EXPOSE 8080
COPY --from=builder /tmp/passwd /tmp/group /etc/
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /workspace/tibber-exporter .
USER 65532:65532
ENTRYPOINT ["/tibber-exporter"]