-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDockerfile
33 lines (23 loc) · 894 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
ARG GO_VERSION=latest
FROM golang:${GO_VERSION} AS build
ARG VERSION
RUN apt-get install git make
WORKDIR /exporter
COPY Makefile go.mod go.sum /exporter/
COPY .git/ ./.git/
COPY cmd/ ./cmd/
COPY internal/ ./internal/
RUN make build RELEASE_MODE=1 VERSION=${VERSION}
FROM scratch
ARG VERSION
LABEL maintainer="Michael DOUBEZ <[email protected]>"
# OpenContainers Annotations Spec
LABEL org.opencontainers.image.description="Prometheus exporter gathering metrics about file size, modification time and other stats." \
org.opencontainers.image.licenses=MIT \
org.opencontainers.image.source=https://github.com/michael-doubez/filestat_exporter \
org.opencontainers.image.title=filestat_exporter \
org.opencontainers.image.version=${VERSION}
COPY --from=build /exporter/filestat_exporter /usr/bin/
USER nobody
EXPOSE 9943
ENTRYPOINT ["/usr/bin/filestat_exporter"]