forked from ndecker/fritzbox_exporter
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathDockerfile.arm64v8
36 lines (22 loc) · 809 Bytes
/
Dockerfile.arm64v8
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
36
FROM alpine AS qemu
# QEMU Download
ENV QEMU_URL https://github.com/balena-io/qemu/releases/download/v5.2.0%2Bbalena4/qemu-5.2.0.balena4-aarch64.tar.gz
RUN apk add curl && curl -L -s ${QEMU_URL} | tar zxvf - -C . --strip-components 1
FROM arm64v8/golang:buster AS build-env
# Add QEMU
COPY --from=qemu qemu-aarch64-static /usr/bin
LABEL maintainer="Max Schmitt <[email protected]>"
LABEL description="FRITZ!Box Prometheus exporter"
COPY go.mod /go.mod
COPY go.sum /go.sum
RUN go mod download
COPY . /fritzbox_exporter
WORKDIR /fritzbox_exporter
RUN CGO_ENABLED=0 go build -o /out cmd/exporter/exporter.go
FROM arm64v8/alpine
# Add QEMU
COPY --from=qemu qemu-aarch64-static /usr/bin
RUN apk update && apk add ca-certificates
COPY --from=build-env /out /exporter
EXPOSE 9133
ENTRYPOINT ["/exporter"]