From e44e0a65981eca8c3066a41657a4949af04b0e2d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Langa?= Date: Tue, 17 Mar 2020 11:33:57 +0100 Subject: [PATCH] Compress RUN statements into one to avoid layer proliferation Thanks for the suggestion, @imomaliev. --- gallery/Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gallery/Dockerfile b/gallery/Dockerfile index b7d0ac1..7a18b7e 100644 --- a/gallery/Dockerfile +++ b/gallery/Dockerfile @@ -1,11 +1,11 @@ FROM python:3.8.2-slim -RUN apt-get update -RUN apt-get upgrade -y -RUN apt-get install git apt-utils -y - -RUN git config --global user.email "black@psf.github.com" -RUN git config --global user.name "Gallery/Black" +# note: a single RUN to avoid too many image layers being produced +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install git apt-utils -y \ + && git config --global user.email "black@psf.github.com" \ + && git config --global user.name "Gallery/Black" COPY gallery.py / ENTRYPOINT ["python", "/gallery.py"] -- 2.39.5