refactor: move download logic from Dockerfiles to build.sh scripts

Move complex download commands from Dockerfiles to build.sh scripts for consistency:
- pgbouncer_exporter, bind_exporter, exportarr, node_exporter, postgres_exporter: GitHub downloads
- vmagent, vmalert: VictoriaMetrics vmutils downloads
- vminsert, vmselect, vmstorage: VictoriaMetrics cluster downloads

All Dockerfiles now follow the simple template pattern with download logic properly contained in build scripts.
This commit is contained in:
Ben Vincent 2025-09-29 21:53:08 +10:00
parent 325b830952
commit 46016bae5c
20 changed files with 55 additions and 43 deletions

View File

@ -11,11 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE}
ARG PACKAGE_VERSION
ENV PACKAGE_VERSION=${PACKAGE_VERSION}
# Copy nfpm.yaml from the context into the container
# Copy resources from the context into the container
COPY resources /app/resources
# Download the required files
RUN curl --output - -L https://github.com/prometheus-community/bind_exporter/releases/download/v${PACKAGE_VERSION}/bind_exporter-${PACKAGE_VERSION}.linux-amd64.tar.gz | tar --strip-components=1 -xzf -
# Default command to build RPMs
CMD /app/resources/build.sh

View File

@ -1,2 +1,6 @@
#!/usr/bin/bash
# Download the required files
curl --output - -L https://github.com/prometheus-community/bind_exporter/releases/download/v${PACKAGE_VERSION}/bind_exporter-${PACKAGE_VERSION}.linux-amd64.tar.gz | tar --strip-components=1 -xzf -
nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm

View File

@ -11,11 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE}
ARG PACKAGE_VERSION
ENV PACKAGE_VERSION=${PACKAGE_VERSION}
# Copy nfpm.yaml from the context into the container
# Copy resources from the context into the container
COPY resources /app/resources
# Download the required files
RUN curl --output - -L https://github.com/onedr0p/exportarr/releases/download/v${PACKAGE_VERSION}/exportarr_${PACKAGE_VERSION}_linux_amd64.tar.gz | tar --strip-components=1 -xzf -
# Default command to build RPMs
CMD /app/resources/build.sh

View File

@ -1,2 +1,6 @@
#!/usr/bin/bash
# Download the required files
curl --output - -L https://github.com/onedr0p/exportarr/releases/download/v${PACKAGE_VERSION}/exportarr_${PACKAGE_VERSION}_linux_amd64.tar.gz | tar --strip-components=1 -xzf -
nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm

View File

@ -11,11 +11,9 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE}
ARG PACKAGE_VERSION
ENV PACKAGE_VERSION=${PACKAGE_VERSION}
# Copy nfpm.yaml from the context into the container
# Copy resources from the context into the container
COPY resources /app/resources
# Download the required files
RUN curl --output - -L https://github.com/prometheus/node_exporter/releases/download/v${PACKAGE_VERSION}/node_exporter-${PACKAGE_VERSION}.linux-amd64.tar.gz | tar --strip-components=1 -xzf -
# Default command to build RPMs
CMD /app/resources/build.sh

View File

@ -1,2 +1,6 @@
#!/usr/bin/bash
# Download the required files
curl --output - -L https://github.com/prometheus/node_exporter/releases/download/v${PACKAGE_VERSION}/node_exporter-${PACKAGE_VERSION}.linux-amd64.tar.gz | tar --strip-components=1 -xzf -
nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm

View File

@ -11,11 +11,8 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE}
ARG PACKAGE_VERSION
ENV PACKAGE_VERSION=${PACKAGE_VERSION}
# Copy nfpm.yaml from the context into the container
# Copy resources from the context into the container
COPY resources /app/resources
# Download the required files
RUN curl --output - -L https://github.com/prometheus-community/pgbouncer_exporter/releases/download/v${PACKAGE_VERSION}/pgbouncer_exporter-${PACKAGE_VERSION}.linux-amd64.tar.gz | tar --strip-components=1 -xzf -
# Default command to build RPMs
CMD /app/resources/build.sh

View File

@ -1,2 +1,6 @@
#!/usr/bin/bash
# Download the required files
curl --output - -L https://github.com/prometheus-community/pgbouncer_exporter/releases/download/v${PACKAGE_VERSION}/pgbouncer_exporter-${PACKAGE_VERSION}.linux-amd64.tar.gz | tar --strip-components=1 -xzf -
nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm

View File

@ -11,11 +11,9 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE}
ARG PACKAGE_VERSION
ENV PACKAGE_VERSION=${PACKAGE_VERSION}
# Copy nfpm.yaml from the context into the container
# Copy resources from the context into the container
COPY resources /app/resources
# Download the required files
RUN curl --output - -L https://github.com/prometheus-community/postgres_exporter/releases/download/v${PACKAGE_VERSION}/postgres_exporter-${PACKAGE_VERSION}.linux-amd64.tar.gz | tar --strip-components=1 -xzf -
# Default command to build RPMs
CMD /app/resources/build.sh

View File

@ -1,2 +1,6 @@
#!/usr/bin/bash
# Download the required files
curl --output - -L https://github.com/prometheus-community/postgres_exporter/releases/download/v${PACKAGE_VERSION}/postgres_exporter-${PACKAGE_VERSION}.linux-amd64.tar.gz | tar --strip-components=1 -xzf -
nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm

View File

@ -11,13 +11,9 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE}
ARG PACKAGE_VERSION
ENV PACKAGE_VERSION=${PACKAGE_VERSION}
# Copy nfpm.yaml from the context into the container
# Copy resources from the context into the container
COPY resources /app/resources
# Download the required files
RUN wget -O /app/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz \
https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz && \
tar xf vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz
# Default command to build RPMs
CMD /app/resources/build.sh

View File

@ -1,2 +1,7 @@
#!/usr/bin/bash
# Download the required files
wget -O /app/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz
tar xf vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz
nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm

View File

@ -11,13 +11,9 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE}
ARG PACKAGE_VERSION
ENV PACKAGE_VERSION=${PACKAGE_VERSION}
# Copy nfpm.yaml from the context into the container
# Copy resources from the context into the container
COPY resources /app/resources
# Download the required files
RUN wget -O /app/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz \
https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz && \
tar xf vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz
# Default command to build RPMs
CMD /app/resources/build.sh

View File

@ -1,2 +1,7 @@
#!/usr/bin/bash
# Download the required files
wget -O /app/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz
tar xf vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz
nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm

View File

@ -11,13 +11,9 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE}
ARG PACKAGE_VERSION
ENV PACKAGE_VERSION=${PACKAGE_VERSION}
# Copy nfpm.yaml from the context into the container
# Copy resources from the context into the container
COPY resources /app/resources
# Download the required files
RUN wget -O /app/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz \
https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz && \
tar xf victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz
# Default command to build RPMs
CMD /app/resources/build.sh

View File

@ -1,2 +1,7 @@
#!/usr/bin/bash
# Download the required files
wget -O /app/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz
tar xf victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz
nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm

View File

@ -11,13 +11,9 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE}
ARG PACKAGE_VERSION
ENV PACKAGE_VERSION=${PACKAGE_VERSION}
# Copy nfpm.yaml from the context into the container
# Copy resources from the context into the container
COPY resources /app/resources
# Download the required files
RUN wget -O /app/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz \
https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz && \
tar xf victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz
# Default command to build RPMs
CMD /app/resources/build.sh

View File

@ -1,2 +1,7 @@
#!/usr/bin/bash
# Download the required files
wget -O /app/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz
tar xf victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz
nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm

View File

@ -11,13 +11,9 @@ ENV PACKAGE_RELEASE=${PACKAGE_RELEASE}
ARG PACKAGE_VERSION
ENV PACKAGE_VERSION=${PACKAGE_VERSION}
# Copy nfpm.yaml from the context into the container
# Copy resources from the context into the container
COPY resources /app/resources
# Download the required files
RUN wget -O /app/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz \
https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz && \
tar xf victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz
# Default command to build RPMs
CMD /app/resources/build.sh

View File

@ -1,2 +1,7 @@
#!/usr/bin/bash
# Download the required files
wget -O /app/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz
tar xf victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz
nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm