From 4794c2b6ab4b33c6a20dade1bf773bbe1f9dc6f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20P=C3=B6schl?= Date: Sat, 15 May 2021 11:06:17 +0200 Subject: [PATCH] Install dependencies before installing from pypi for better layer caching --- docker-files/debian.Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docker-files/debian.Dockerfile b/docker-files/debian.Dockerfile index f9f1777a..da80e309 100644 --- a/docker-files/debian.Dockerfile +++ b/docker-files/debian.Dockerfile @@ -19,7 +19,11 @@ RUN apt-get update && \ FROM build as remoteInstall -# Force rebuild otherwise it could be cached without rerun +# Install the dependencies beforehand to make them cacheable +COPY requirements.txt . +RUN pip3 install --no-cache-dir --user -r requirements.txt + +# Force install otherwise it could be cached without rerun ARG CHANGING_ARG RUN pip3 install --no-cache-dir --user glances[all] -- GitLab