All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] CI: Clean up alpine containers
@ 2022-02-18 13:18 Andrew Cooper
  2022-02-18 14:46 ` Anthony PERARD
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cooper @ 2022-02-18 13:18 UTC (permalink / raw)
  To: Xen-devel
  Cc: Andrew Cooper, Doug Goldstein, Wei Liu, Anthony PERARD,
	Roger Pau Monné,
	Stefano Stabellini

 * `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(-)

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 \
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] CI: Clean up alpine containers
  2022-02-18 13:18 [PATCH] CI: Clean up alpine containers Andrew Cooper
@ 2022-02-18 14:46 ` Anthony PERARD
  2022-02-18 14:59   ` Andrew Cooper
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony PERARD @ 2022-02-18 14:46 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: Xen-devel, Doug Goldstein, Wei Liu, Roger Pau Monné,
	Stefano Stabellini

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,

-- 
Anthony PERARD


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] CI: Clean up alpine containers
  2022-02-18 14:46 ` Anthony PERARD
@ 2022-02-18 14:59   ` Andrew Cooper
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2022-02-18 14:59 UTC (permalink / raw)
  To: Anthony Perard
  Cc: Xen-devel, Doug Goldstein, Wei Liu, Roger Pau Monne, Stefano Stabellini

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-18 14:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-18 13:18 [PATCH] CI: Clean up alpine containers Andrew Cooper
2022-02-18 14:46 ` Anthony PERARD
2022-02-18 14:59   ` Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.