forked from thought-machine/prometheus-cardinality-exporter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-builder
34 lines (19 loc) · 945 Bytes
/
Dockerfile-builder
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
# golang:1.13.1-alpine3.10
FROM golang@sha256:2293e952c79b8b3a987e1e09d48b6aa403d703cef9a8fa316d30ba2918d37367 as builder
RUN ln -s /usr/local/go/bin/go /usr/local/bin/go
RUN apk add --no-cache curl wget gcc make bash git musl-dev libc6-compat gettext
RUN touch /root/.profile
WORKDIR /go/github.com/thought-machine/prometheus-cardinality-exporter
COPY . .
RUN ./pleasew test //... --exclude 'docker'
RUN ./pleasew build //... --exclude 'docker'
# alpine:3.14.2
FROM alpine@sha256:69704ef328d05a9f806b6b8502915e6a0a4faa4d72018dc42343f511490daf8a
EXPOSE 9090
COPY --from=builder /go/github.com/thought-machine/prometheus-cardinality-exporter/plz-out/bin/prometheus-cardinality-exporter /home/app/prometheus-cardinality-exporter
# Max user
RUN addgroup -g 255999 -S app && \
adduser -u 255999 -S app -G app
RUN chmod +x /home/app/prometheus-cardinality-exporter
USER app
ENTRYPOINT ["/home/app/prometheus-cardinality-exporter"]