forked from percona/postgres_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
ARG ARCH="amd64" | ||
ARG OS="linux" | ||
FROM quay.io/prometheus/busybox-${OS}-${ARCH}:latest | ||
LABEL maintainer="The Prometheus Authors <[email protected]>" | ||
|
||
ARG ARCH="amd64" | ||
ARG OS="linux" | ||
COPY .build/${OS}-${ARCH}/postgres_exporter /bin/postgres_exporter | ||
|
||
EXPOSE 9187 | ||
USER nobody | ||
ENTRYPOINT [ "/bin/postgres_exporter" ] | ||
FROM golang:1.12.6-alpine as build | ||
WORKDIR ${GOPATH}/src/github.com/quintoandar | ||
RUN apk update && apk add make git curl && git clone https://github.com/quintoandar/postgres_exporter.git | ||
WORKDIR ${GOPATH}/src/github.com/quintoandar/postgres_exporter | ||
RUN go get -u github.com/prometheus/promu | ||
RUN make build | ||
RUN chmod +x postgres_exporter && mv postgres_exporter /tmp/postgres_exporter | ||
|
||
|
||
FROM alpine:3.18 as final | ||
|
||
COPY --from=build ["/tmp/postgres_exporter", "/" ] | ||
|
||
WORKDIR /opt/exporter | ||
|
||
EXPOSE 9187 | ||
|
||
ENTRYPOINT [ "/postgres_exporter" ] |