From c003fbafeb2d67b1ef70d6f860e83541bfddb56c Mon Sep 17 00:00:00 2001 From: Diego Heras Date: Thu, 28 Jul 2022 01:03:59 +0200 Subject: [PATCH] Update base Docker image and reduce image size. Resolves #17 (#31) --- Dockerfile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3205d24..7985389 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,17 @@ -FROM alpine:3.12 +FROM python:3.10-alpine3.16 WORKDIR /usr/src -RUN apk update; \ - apk add --no-cache python3 py3-pip smartmontools; \ - python3 -m pip install prometheus_client; +RUN apk add --no-cache smartmontools \ + && pip install prometheus_client \ + # remove temporary files + && rm -rf /root/.cache/ \ + && find / -name '*.pyc' -delete -ADD smartprom.py . +COPY ./smartprom.py /smartprom.py EXPOSE 9902 -ENTRYPOINT "./smartprom.py" +ENTRYPOINT ["/usr/local/bin/python", "/smartprom.py"] + +# HELP +# docker build -t matusnovak/prometheus-smartctl:test .