-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathDockerfile
35 lines (23 loc) · 815 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
30
31
32
33
34
35
FROM --platform=$BUILDPLATFORM golang:1.23.4-alpine AS builder
ARG TARGETOS
ARG TARGETARCH
ENV GOOS=$TARGETOS
ENV GOARCH=$TARGETARCH
RUN apk add --no-cache make git bash
WORKDIR /build
COPY go.mod go.sum /build/
RUN go mod download
RUN go mod verify
COPY . /build/
RUN make build-binary
FROM --platform=$TARGETPLATFORM busybox
LABEL maintainer="Robert Jacob <xperimental@solidproject.de>"
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /build/netatmo-exporter /bin/netatmo-exporter
RUN mkdir -p /var/lib/netatmo-exporter/ \
&& chown nobody /var/lib/netatmo-exporter/
USER nobody
EXPOSE 9210
ENV NETATMO_EXPORTER_TOKEN_FILE=/var/lib/netatmo-exporter/netatmo-token.json
VOLUME /var/lib/netatmo-exporter/
ENTRYPOINT ["/bin/netatmo-exporter"]