-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Dockerfile
33 lines (25 loc) · 736 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
FROM golang:1.23.1-alpine AS builder
LABEL builder=true
ENV CGO_ENABLED=0
ENV GO111MODULE=on
ENV APPPATH /app
#RUN apk add --update -t build-deps go git mercurial libc-dev gcc libgcc
RUN apk add --update -t build-deps git
COPY . $APPPATH
RUN cd $APPPATH && go get -d \
&& go test -short ./... \
&& go build \
-a \
-ldflags '-s -w -extldflags "-static"' \
-o /bin/main
FROM alpine:3.20.3
LABEL maintainer="Tobias Gesellchen <[email protected]> (@gesellix)"
ENV TELEMETRY_ADDRESS="0.0.0.0:9984"
ENV LOGTOSTDERR="true"
EXPOSE 9984
ENTRYPOINT [ "/couchdb-prometheus-exporter" ]
CMD [ ]
RUN apk --no-cache add ca-certificates \
&& adduser -DH user
USER user
COPY --from=builder /bin/main /couchdb-prometheus-exporter