From 559844865aab413eb28bacb73c6a051c67194aea Mon Sep 17 00:00:00 2001 From: chantra Date: Mon, 26 Aug 2024 15:08:07 -0700 Subject: [PATCH] build_kernel: Speed up docker image creation When building multiple kernels on the same machine, docker has to rebuild the layers over and over because the values of KERNEL_TAG/DISTRO have changed (and would be the same of KERNEL_REPO was modified). By moving them *after* the package installation, it does speed up the turnover. Signed-off-by: Manu Bretelle --- scripts/docker/Dockerfile.kernel | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/docker/Dockerfile.kernel b/scripts/docker/Dockerfile.kernel index 289b5c1..7b8e26d 100644 --- a/scripts/docker/Dockerfile.kernel +++ b/scripts/docker/Dockerfile.kernel @@ -1,10 +1,6 @@ ARG ALPINE_VERSION FROM alpine:${ALPINE_VERSION} -ARG KERNEL_REPO=https://github.com/torvalds/linux.git -ARG KERNEL_TAG -ARG DISTRO - RUN apk update && apk add \ bash \ bison \ @@ -26,6 +22,10 @@ RUN apk update && apk add \ WORKDIR / +ARG KERNEL_REPO=https://github.com/torvalds/linux.git +ARG KERNEL_TAG +ARG DISTRO + RUN git clone --depth 1 ${KERNEL_REPO} linux --branch ${KERNEL_TAG} WORKDIR linux