diff mbox series

CI: Clean up alpine containers

Message ID 20220218131811.31133-1-andrew.cooper3@citrix.com (mailing list archive)
State New, archived
Headers show
Series CI: Clean up alpine containers | expand

Commit Message

Andrew Cooper Feb. 18, 2022, 1:18 p.m. UTC
* `apk --no-cache` is the preferred way of setting up containers, and it does
   shrink the image by a few MB.
 * Neither container needs curl-dev.
 * Flex and bison are needed for Xen, so move to the Xen block.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Doug Goldstein <cardoe@cardoe.com>
CC: Wei Liu <wl@xen.org>
CC: Anthony PERARD <anthony.perard@citrix.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>

I've already rebuilt the containers and confirmed that the build is still fine.
---
 automation/build/alpine/3.12-arm64v8.dockerfile | 69 ++++++++++-------------
 automation/build/alpine/3.12.dockerfile         | 75 +++++++++++--------------
 2 files changed, 65 insertions(+), 79 deletions(-)

Comments

Anthony PERARD Feb. 18, 2022, 2:46 p.m. UTC | #1
On Fri, Feb 18, 2022 at 01:18:11PM +0000, Andrew Cooper wrote:
>  * `apk --no-cache` is the preferred way of setting up containers, and it does
>    shrink the image by a few MB.
>  * Neither container needs curl-dev.
>  * Flex and bison are needed for Xen, so move to the Xen block.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Doug Goldstein <cardoe@cardoe.com>
> CC: Wei Liu <wl@xen.org>
> CC: Anthony PERARD <anthony.perard@citrix.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> 
> I've already rebuilt the containers and confirmed that the build is still fine.
> ---
> diff --git a/automation/build/alpine/3.12-arm64v8.dockerfile b/automation/build/alpine/3.12-arm64v8.dockerfile
> index a1ac9605959e..006cdb3668b3 100644
> --- a/automation/build/alpine/3.12-arm64v8.dockerfile
> +++ b/automation/build/alpine/3.12-arm64v8.dockerfile
> @@ -8,46 +8,39 @@ RUN mkdir /build
>  WORKDIR /build
>  
>  # build depends
> -RUN \
> -  # apk
> -  apk update && \
> +RUN apk --no-cache add \
>    \
>    # xen build deps
> -  apk add argp-standalone && \
> -  apk add autoconf && \
> -  apk add automake && \
> -  apk add bash && \
> -  apk add curl && \
> -  apk add curl-dev && \
> -  apk add dev86 && \
> -  apk add dtc-dev && \
> -  apk add gcc  && \
> +  argp-standalone \
> +  autoconf \
> +  automake \

Since you are removing some other pkgs, I don't think "automake" is
needed either. We only use "autoconf" and "autoheader". (Maybe the
automake pkg give access to something we need, but I'm not sure about
that.)


In any case, changes looks good:
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,
Andrew Cooper Feb. 18, 2022, 2:59 p.m. UTC | #2
On 18/02/2022 14:46, Anthony PERARD wrote:
> On Fri, Feb 18, 2022 at 01:18:11PM +0000, Andrew Cooper wrote:
>>  * `apk --no-cache` is the preferred way of setting up containers, and it does
>>    shrink the image by a few MB.
>>  * Neither container needs curl-dev.
>>  * Flex and bison are needed for Xen, so move to the Xen block.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Doug Goldstein <cardoe@cardoe.com>
>> CC: Wei Liu <wl@xen.org>
>> CC: Anthony PERARD <anthony.perard@citrix.com>
>> CC: Roger Pau Monné <roger.pau@citrix.com>
>> CC: Stefano Stabellini <sstabellini@kernel.org>
>>
>> I've already rebuilt the containers and confirmed that the build is still fine.
>> ---
>> diff --git a/automation/build/alpine/3.12-arm64v8.dockerfile b/automation/build/alpine/3.12-arm64v8.dockerfile
>> index a1ac9605959e..006cdb3668b3 100644
>> --- a/automation/build/alpine/3.12-arm64v8.dockerfile
>> +++ b/automation/build/alpine/3.12-arm64v8.dockerfile
>> @@ -8,46 +8,39 @@ RUN mkdir /build
>>  WORKDIR /build
>>  
>>  # build depends
>> -RUN \
>> -  # apk
>> -  apk update && \
>> +RUN apk --no-cache add \
>>    \
>>    # xen build deps
>> -  apk add argp-standalone && \
>> -  apk add autoconf && \
>> -  apk add automake && \
>> -  apk add bash && \
>> -  apk add curl && \
>> -  apk add curl-dev && \
>> -  apk add dev86 && \
>> -  apk add dtc-dev && \
>> -  apk add gcc  && \
>> +  argp-standalone \
>> +  autoconf \
>> +  automake \
> Since you are removing some other pkgs, I don't think "automake" is
> needed either. We only use "autoconf" and "autoheader". (Maybe the
> automake pkg give access to something we need, but I'm not sure about
> that.)

Very good observation.  We don't have automake in any other containers. 
I'll strip it out and double check the resulting build.

> In any case, changes looks good:
> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks.

~Andrew
diff mbox series

Patch

diff --git a/automation/build/alpine/3.12-arm64v8.dockerfile b/automation/build/alpine/3.12-arm64v8.dockerfile
index a1ac9605959e..006cdb3668b3 100644
--- a/automation/build/alpine/3.12-arm64v8.dockerfile
+++ b/automation/build/alpine/3.12-arm64v8.dockerfile
@@ -8,46 +8,39 @@  RUN mkdir /build
 WORKDIR /build
 
 # build depends
-RUN \
-  # apk
-  apk update && \
+RUN apk --no-cache add \
   \
   # xen build deps
-  apk add argp-standalone && \
-  apk add autoconf && \
-  apk add automake && \
-  apk add bash && \
-  apk add curl && \
-  apk add curl-dev && \
-  apk add dev86 && \
-  apk add dtc-dev && \
-  apk add gcc  && \
+  argp-standalone \
+  autoconf \
+  automake \
+  bash \
+  bison \
+  curl \
+  dev86 \
+  dtc-dev \
+  flex \
+  gcc \
   # gettext for Xen < 4.13
-  apk add gettext && \
-  apk add git && \
-  apk add iasl && \
-  apk add libaio-dev && \
-  apk add libfdt && \
-  apk add linux-headers && \
-  apk add make && \
-  apk add musl-dev  && \
-  apk add ncurses-dev && \
-  apk add patch  && \
-  apk add python3-dev && \
-  apk add texinfo && \
-  apk add util-linux-dev && \
-  apk add xz-dev && \
-  apk add yajl-dev && \
-  apk add zlib-dev && \
+  gettext \
+  git \
+  iasl \
+  libaio-dev \
+  libfdt \
+  linux-headers \
+  make \
+  musl-dev  \
+  ncurses-dev \
+  patch  \
+  python3-dev \
+  texinfo \
+  util-linux-dev \
+  xz-dev \
+  yajl-dev \
+  zlib-dev \
   \
   # qemu build deps
-  apk add bison && \
-  apk add flex && \
-  apk add glib-dev && \
-  apk add libattr && \
-  apk add libcap-ng-dev && \
-  apk add pixman-dev && \
-  \
-  # cleanup
-  rm -rf /tmp/* && \
-  rm -f /var/cache/apk/*
+  glib-dev \
+  libattr \
+  libcap-ng-dev \
+  pixman-dev \
diff --git a/automation/build/alpine/3.12.dockerfile b/automation/build/alpine/3.12.dockerfile
index 4cce7ab926dc..22cad2524972 100644
--- a/automation/build/alpine/3.12.dockerfile
+++ b/automation/build/alpine/3.12.dockerfile
@@ -8,49 +8,42 @@  RUN mkdir /build
 WORKDIR /build
 
 # build depends
-RUN \
-  # apk
-  apk update && \
+RUN apk --no-cache add \
   \
   # xen build deps
-  apk add argp-standalone && \
-  apk add autoconf && \
-  apk add automake && \
-  apk add bash && \
-  apk add curl && \
-  apk add curl-dev && \
-  apk add dev86 && \
-  apk add gcc  && \
-  apk add g++ && \
-  apk add clang  && \
+  argp-standalone \
+  autoconf \
+  automake \
+  bash \
+  bison \
+  clang \
+  curl \
+  dev86 \
+  flex \
+  g++ \
+  gcc \
   # gettext for Xen < 4.13
-  apk add gettext && \
-  apk add git && \
-  apk add grep && \
-  apk add iasl && \
-  apk add libaio-dev && \
-  apk add linux-headers && \
-  apk add make && \
-  apk add musl-dev  && \
-  apk add libc6-compat && \
-  apk add ncurses-dev && \
-  apk add patch  && \
-  apk add python3-dev && \
-  apk add texinfo && \
-  apk add util-linux-dev && \
-  apk add xz-dev && \
-  apk add yajl-dev && \
-  apk add zlib-dev && \
+  gettext \
+  git \
+  grep \
+  iasl \
+  libaio-dev \
+  libc6-compat \
+  linux-headers \
+  make \
+  musl-dev  \
+  ncurses-dev \
+  patch  \
+  python3-dev \
+  texinfo \
+  util-linux-dev \
+  xz-dev \
+  yajl-dev \
+  zlib-dev \
   \
   # qemu build deps
-  apk add bison && \
-  apk add flex && \
-  apk add glib-dev && \
-  apk add libattr && \
-  apk add libcap-ng-dev && \
-  apk add ninja && \
-  apk add pixman-dev && \
-  \
-  # cleanup
-  rm -rf /tmp/* && \
-  rm -f /var/cache/apk/*
+  glib-dev \
+  libattr \
+  libcap-ng-dev \
+  ninja \
+  pixman-dev \