From: Ɓukasz Langa Date: Tue, 17 Mar 2020 10:33:57 +0000 (+0100) Subject: Compress RUN statements into one to avoid layer proliferation X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/e44e0a65981eca8c3066a41657a4949af04b0e2d Compress RUN statements into one to avoid layer proliferation Thanks for the suggestion, @imomaliev. --- 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"]