forked from solacecommunity/solace-prometheus-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (22 loc) · 754 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
FROM golang:1.20.12 AS builder
LABEL builder=true
ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64
WORKDIR /go/src/app
COPY . .
RUN go get -d -v ./... \
&& go install -v ./... \
&& go test -short ./... \
&& go build \
-a \
-ldflags '-s -w -extldflags "-static"' \
-o /bin/solace_prometheus_exporter
FROM scratch
LABEL maintainer="https://github.com/solacecommunity/solace-prometheus-exporter"
EXPOSE 9628
ENTRYPOINT [ "/solace_prometheus_exporter", "--config-file=/etc/solace/solace_prometheus_exporter.ini" ]
CMD [ ]
COPY docker/solace_prometheus_exporter.ini /etc/solace/solace_prometheus_exporter.ini
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /bin/solace_prometheus_exporter /solace_prometheus_exporter