From ff5ef50ca3e1f044224b9bda4cec67542efefc3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Tue, 13 Aug 2024 15:21:27 +0200 Subject: [PATCH] fix: clean after building for smaller layers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Kröning --- Dockerfile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index e8c6fa4..acee53e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,7 +43,8 @@ RUN set -eux; \ --enable-lto \ --enable-plugin; \ make -O -j$(nproc); \ - make install + make install; \ + make clean FROM buildpack-deps:bookworm AS gcc RUN set -eux; \ @@ -88,7 +89,8 @@ RUN set -eux; \ --enable-lto \ --disable-symvers; \ make -O -j$(nproc) all-gcc; \ - make install-gcc + make install-gcc; \ + make clean ENV PATH=$PREFIX/bin:$PATH COPY --link --from=kernel /kernel/libhermit.a /kernel/libhermit.a @@ -106,7 +108,8 @@ RUN set -eux; \ --enable-newlib-io-c99-formats \ --enable-newlib-multithread; \ make -O -j$(nproc); \ - make install + make install; \ + make clean ADD --link https://github.com/hermit-os/pthread-embedded.git /pthread-embedded WORKDIR /pthread-embedded @@ -115,7 +118,8 @@ RUN set -eux; \ --target=$TARGET \ --prefix=$PREFIX; \ make -O -j$(nproc); \ - make install + make install; \ + make clean WORKDIR /gcc/builddir RUN set -eux; \ @@ -136,7 +140,8 @@ RUN set -eux; \ --enable-lto \ --disable-symver; \ make -O -j$(nproc); \ - make install + make install; \ + make clean FROM rust:bookworm AS toolchain ARG PREFIX