I see here that
Docker best practices says .. minimise the number of layers in our images
The tips given are to chain multiple lines in the dockerfile with \
so as to combine many lines of code into single commands. A specific example being:
Acceptable:
RUN pip install jupyter
RUN pip install pandas
Better:
RUN pip install jupyter && \
pip install pandas
From this knowledge, I understand what should be done, however, I don't understand why. What are the advantages of minimising the number of layers in a Docker image? (or, conversely, what are the disadvantages of not doing so?)
RUN
shouldn't be there.