FROM danielberteaud/alpine:24.3-1 AS builder ARG EXPORTER_VERSION=0.15.0 ADD https://github.com/prometheus-community/postgres_exporter/releases/download/v${EXPORTER_VERSION}/postgres_exporter-${EXPORTER_VERSION}.linux-amd64.tar.gz /tmp ADD https://github.com/prometheus-community/postgres_exporter/releases/download/v${EXPORTER_VERSION}/sha256sums.txt /tmp RUN set -euxo pipefail &&\ apk --no-cache add tar gzip &&\ cd /tmp &&\ grep postgres_exporter-${EXPORTER_VERSION}.linux-amd64.tar.gz sha256sums.txt | sha256sum -c &&\ tar xvzf postgres_exporter-${EXPORTER_VERSION}.linux-amd64.tar.gz &&\ mv postgres_exporter-${EXPORTER_VERSION}.linux-amd64/postgres_exporter /usr/local/bin/postgres_exporter &&\ chown root:root /usr/local/bin/postgres_exporter &&\ chmod 755 /usr/local/bin/postgres_exporter FROM danielberteaud/alpine:24.3-1 MAINTAINER Daniel Berteaud COPY --from=builder /usr/local/bin/postgres_exporter /usr/local/bin/postgres_exporter CMD ["postgres_exporter"]