This repository has been archived on 2024-08-04. You can view files and clone it, but cannot push or open issues or pull requests.
stagex/linux-headers/Dockerfile

28 lines
833 B
Docker
Raw Normal View History

2023-12-10 18:05:50 +00:00
ARG REGISTRY=local
FROM ${REGISTRY}/musl:latest as musl
2023-12-16 23:50:40 +00:00
FROM ${REGISTRY}/bootstrap:latest as base
2023-11-14 04:24:47 +00:00
ENV SRC_SITE https://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/
ENV SRC_VERSION 6.6
ENV SRC_HASH d926a06c63dd8ac7df3f86ee1ffc2ce2a3b81a2d168484e76b5b389aba8e56d0
2023-12-16 23:50:40 +00:00
FROM base as fetch
2023-11-14 04:24:47 +00:00
RUN wget ${SRC_SITE}/linux-${SRC_VERSION}.tar.xz
RUN echo "${SRC_HASH} linux-${SRC_VERSION}.tar.xz" | sha256sum -c
2023-12-16 23:50:40 +00:00
FROM fetch as build
2023-11-14 04:24:47 +00:00
RUN tar -xf linux-${SRC_VERSION}.tar.xz
WORKDIR linux-${SRC_VERSION}
2023-12-16 23:50:40 +00:00
RUN make headers
FROM build as install
USER 0:0
RUN set -eux; \
2023-11-14 04:24:47 +00:00
mkdir -p /rootfs/usr; \
cp -a usr/include /rootfs/usr/; \
find /rootfs/usr/include/ ! -iname "*.h" -type f -exec rm -v {} \+; \
2023-12-16 23:50:40 +00:00
rm -rf /rootfs/usr/include/drm; \
find /rootfs -exec touch -hcd "@0" "{}" +
2023-11-14 04:24:47 +00:00
2023-12-12 17:45:39 +00:00
FROM scratch as package
2023-12-16 23:50:40 +00:00
COPY --from=install /rootfs /