Skip to content

Commit

Permalink
build_kernel: Speed up docker image creation
Browse files Browse the repository at this point in the history
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 <chantr4@gmail.com>
  • Loading branch information
chantra authored and danobi committed Aug 27, 2024
1 parent 0ac3cf3 commit 6c08afd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/docker/Dockerfile.kernel
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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

Expand Down

0 comments on commit 6c08afd

Please sign in to comment.