Skip to content

Commit 73a8f9d

Browse files
myrrcwinter-loo
authored andcommitted
download exporters from releases rather than using docker images (neondatabase#10551)
Use releases for postgres-exporter, pgbouncer-exporter, and sql-exporter
1 parent ec3ec31 commit 73a8f9d

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

compute/compute-node.Dockerfile

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ARG TAG=pinned
55
ARG BUILD_TAG
66
ARG DEBIAN_VERSION=bookworm
77
ARG DEBIAN_FLAVOR=${DEBIAN_VERSION}-slim
8+
ARG ALPINE_CURL_VERSION=8.11.1
89

910
#########################################################################################
1011
#
@@ -1266,16 +1267,31 @@ RUN set -e \
12661267

12671268
#########################################################################################
12681269
#
1269-
# Layers "postgres-exporter", "pgbouncer-exporter", and "sql-exporter"
1270+
# Layer "exporters"
12701271
#
12711272
#########################################################################################
1272-
1273-
FROM quay.io/prometheuscommunity/postgres-exporter:v0.16.0 AS postgres-exporter
1274-
FROM quay.io/prometheuscommunity/pgbouncer-exporter:v0.10.2 AS pgbouncer-exporter
1275-
1276-
# Keep the version the same as in build-tools.Dockerfile and
1277-
# test_runner/regress/test_compute_metrics.py.
1278-
FROM burningalchemist/sql_exporter:0.17.0 AS sql-exporter
1273+
FROM alpine/curl:${ALPINE_CURL_VERSION} AS exporters
1274+
ARG TARGETARCH
1275+
# Keep sql_exporter version same as in build-tools.Dockerfile and
1276+
# test_runner/regress/test_compute_metrics.py
1277+
RUN if [ "$TARGETARCH" = "amd64" ]; then\
1278+
postgres_exporter_sha256='027e75dda7af621237ff8f5ac66b78a40b0093595f06768612b92b1374bd3105';\
1279+
pgbouncer_exporter_sha256='c9f7cf8dcff44f0472057e9bf52613d93f3ffbc381ad7547a959daa63c5e84ac';\
1280+
sql_exporter_sha256='38e439732bbf6e28ca4a94d7bc3686d3fa1abdb0050773d5617a9efdb9e64d08';\
1281+
else\
1282+
postgres_exporter_sha256='131a376d25778ff9701a4c81f703f179e0b58db5c2c496e66fa43f8179484786';\
1283+
pgbouncer_exporter_sha256='217c4afd7e6492ae904055bc14fe603552cf9bac458c063407e991d68c519da3';\
1284+
sql_exporter_sha256='11918b00be6e2c3a67564adfdb2414fdcbb15a5db76ea17d1d1a944237a893c6';\
1285+
fi\
1286+
&& curl -sL https://github.com/prometheus-community/postgres_exporter/releases/download/v0.16.0/postgres_exporter-0.16.0.linux-${TARGETARCH}.tar.gz\
1287+
| tar xzf - --strip-components=1 -C.\
1288+
&& curl -sL https://github.com/prometheus-community/pgbouncer_exporter/releases/download/v0.10.2/pgbouncer_exporter-0.10.2.linux-${TARGETARCH}.tar.gz\
1289+
| tar xzf - --strip-components=1 -C.\
1290+
&& curl -sL https://github.com/burningalchemist/sql_exporter/releases/download/0.17.0/sql_exporter-0.17.0.linux-${TARGETARCH}.tar.gz\
1291+
| tar xzf - --strip-components=1 -C.\
1292+
&& echo "${postgres_exporter_sha256} postgres_exporter" | sha256sum -c -\
1293+
&& echo "${pgbouncer_exporter_sha256} pgbouncer_exporter" | sha256sum -c -\
1294+
&& echo "${sql_exporter_sha256} sql_exporter" | sha256sum -c -
12791295

12801296
#########################################################################################
12811297
#
@@ -1403,10 +1419,10 @@ COPY --chmod=0666 --chown=postgres compute/etc/pgbouncer.ini /etc/pgbouncer.ini
14031419
COPY --from=compute-tools --chown=postgres /home/nonroot/target/release-line-debug-size-lto/local_proxy /usr/local/bin/local_proxy
14041420
RUN mkdir -p /etc/local_proxy && chown postgres:postgres /etc/local_proxy
14051421

1406-
# Metrics exporter binaries and configuration files
1407-
COPY --from=postgres-exporter /bin/postgres_exporter /bin/postgres_exporter
1408-
COPY --from=pgbouncer-exporter /bin/pgbouncer_exporter /bin/pgbouncer_exporter
1409-
COPY --from=sql-exporter /bin/sql_exporter /bin/sql_exporter
1422+
# Metrics exporter binaries and configuration files
1423+
COPY --from=exporters ./postgres_exporter /bin/postgres_exporter
1424+
COPY --from=exporters ./pgbouncer_exporter /bin/pgbouncer_exporter
1425+
COPY --from=exporters ./sql_exporter /bin/sql_exporter
14101426

14111427
COPY --chown=postgres compute/etc/postgres_exporter.yml /etc/postgres_exporter.yml
14121428

0 commit comments

Comments
 (0)