qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 05/21] docker: compact debian base


From: Fam Zheng
Subject: Re: [Qemu-devel] [PATCH v2 05/21] docker: compact debian base
Date: Tue, 9 May 2017 16:05:43 +0800
User-agent: Mutt/1.8.0 (2017-02-23)

On Tue, 05/09 08:46, Alex Bennée wrote:
> 
> Fam Zheng <address@hidden> writes:
> 
> > On Mon, 05/08 19:17, Philippe Mathieu-Daudé wrote:
> >> - install common/basic tools at once
> >> - use eatmydata and remove apt cache to save space
> >> - add bison and flex and git
> >> - create deb-src entry and setup Emdebian in the same layer
> >>
> >> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> >> ---
> >>  tests/docker/dockerfiles/debian.docker | 26 +++++++++++++-------------
> >>  1 file changed, 13 insertions(+), 13 deletions(-)
> >>
> >> diff --git a/tests/docker/dockerfiles/debian.docker 
> >> b/tests/docker/dockerfiles/debian.docker
> >> index d08def6a8d..dcded3ce84 100644
> >> --- a/tests/docker/dockerfiles/debian.docker
> >> +++ b/tests/docker/dockerfiles/debian.docker
> >> @@ -9,17 +9,17 @@
> >>  #
> >>  FROM debian:stable-slim
> >>
> >> -# Setup some basic tools we need
> >> -RUN apt update
> >> -RUN apt install -yy aptitude ca-certificates curl
> >> +# Install some basic tools and common build utilities
> >> +RUN apt-get update && \
> >> +    DEBIAN_FRONTEND=noninteractive apt-get install -yy \
> >> +        eatmydata && \
> >> +    DEBIAN_FRONTEND=noninteractive eatmydata apt-get install -y 
> >> --no-install-recommends \
> >> +        aptitude ca-certificates curl \
> >> +        build-essential clang git \
> >> +        bison flex && \
> >> +    apt-get clean
> >
> > Any particular reason to make multiple "RUN" directives into one?
> 
> It reduces the number of layers you generate during the building
> process. I'm not sure how much space that saves in the long run though
> (disk space is pretty cheap ;-).

I don't think it matters much, but refreshing an image gets slower due to
coarser cache, for example when you add a package in the big "apt-get install"
command.

I don't see a strong reason why this is better. It clutters the file and is
inconsistent.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]