diff --git a/Dockerfile b/Dockerfile index 4584f1b..c61f592 100644 --- a/Dockerfile +++ b/Dockerfile @@ -113,7 +113,24 @@ RUN cd build && \ mv /rootfs/usr/lib64/* /rootfs/usr/lib/ && \ rm -rf /rootfs/usr/lib64 +FROM bootstrap-c-toolchain AS build-linux-headers +ARG VERSION=6.12.21 + +WORKDIR /source + +RUN wget https://cdn.kernel.org/pub/linux/kernel/v${VERSION}.tar.xz -O linux.tar.xz + +RUN tar -xJf linux.tar.xz --strip-components=1 + +RUN make -j $(nproc) headers ARCH=x86_64 && \ + find usr/include -name '.*' -delete && \ + rm usr/include/Makefile + +RUN mkdir -p /rootfs/usr/include && \ + cp -rv usr/include/* /rootfs/usr/include + FROM busybox AS final COPY --from=build-make /rootfs/ / COPY --from=build-binutils /rootfs/ / COPY --from=build-gcc /rootfs/ / +COPY --from=build-linux-headers /rootfs/ /