From 81ac229b53d4b0548fe3a03608e453495706a71d Mon Sep 17 00:00:00 2001 From: Chase Relock Date: Thu, 28 Jan 2016 14:44:59 -0800 Subject: [PATCH] Update README Adds more context and information around how to minimize image layers --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 96df709..73dd738 100644 --- a/README.md +++ b/README.md @@ -523,10 +523,13 @@ docker images -viz | dot -Tpng -o docker.png ### Slimming down Docker containers [Intercity Blog](http://bit.ly/1Wwo61N) -- Cleaning APT +- Cleaning APT in a RUN layer +This should be done in the same layer as other apt commands. +Otherwise, the previous layers still persist the original information and your images will still be fat. ``` -RUN apt-get clean -RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN {apt commands} \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ``` - Flatten an image ```