From 886c1d16a77e78555627191b2c3368b193d7e41b Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sun, 26 Jul 2020 20:41:03 +0200 Subject: [PATCH] :hammer: Reduce resulting image with 68Mb --- prometheus/Dockerfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/prometheus/Dockerfile b/prometheus/Dockerfile index 93eb846..aca893e 100755 --- a/prometheus/Dockerfile +++ b/prometheus/Dockerfile @@ -16,7 +16,6 @@ RUN \ ARCH="${BUILD_ARCH}" \ && if [ "${BUILD_ARCH}" = "aarch64" ]; then ARCH="arm64"; fi \ \ - && apk update \ && apk --no-cache add \ python3 \ py3-idna \ @@ -40,8 +39,15 @@ RUN \ && cp -R prometheus-${PROMETHEUS_VERSION}.linux-${ARCH}/consoles/ /etc/prometheus/ \ && rm -r prometheus-${PROMETHEUS_VERSION}.linux-${ARCH} \ && chown -R prometheus:prometheus /etc/prometheus \ - && pip3 install -r /opt/prometheus-configgen/requirements.txt \ - && apk --no-cache del .builddeps + && pip3 install \ + --no-cache-dir \ + --prefer-binary \ + --find-links "https://wheels.home-assistant.io/alpine-3.12/${BUILD_ARCH}/" \ + -r /opt/prometheus-configgen/requirements.txt \ + \ + && apk --no-cache del .builddeps \ + && rm -f -r \ + /tmp/* # Build arguments ARG BUILD_DATE