From 5d7183a0b8e551f52206b4573a5b4a6c042eb071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=A4fer?= Date: Sat, 8 Jan 2022 13:29:28 +0100 Subject: [PATCH] Reinstate cache deletion in multi-stage build Previously, the multi-stage build increased the image size by about 30 MiB (163MiB -> 191MiB). Dropping the caches reduces the image size down to 159MiB, leading to a net improvement of 4 MiB. --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index cc9c74c..8f8c496 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,12 +40,14 @@ RUN set -eu; \ apt-get update ; \ apt-get install -y --no-install-recommends \ python3 python3-pip python3-setuptools python3-wheel; \ - pip3 install hypercorn; + apt-get clean ; rm -rf /var/lib/apt/lists; \ + pip3 install hypercorn; \ + rm -rf /root/.cache; WORKDIR /opt/snikket-web-portal COPY requirements.txt /opt/snikket-web-portal/requirements.txt -RUN pip3 install -r requirements.txt; +RUN pip3 install -r requirements.txt; rm -rf /root/.cache; COPY --from=build /opt/snikket-web-portal/snikket_web/ /opt/snikket-web-portal/snikket_web COPY babel.cfg /opt/snikket-web-portal/babel.cfg