Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dba 793 updating go version 1.21 #244

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions Dockerfile
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 <prometheus-developers@googlegroups.com>"

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.21-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" ]