stagex/packages/linux-generic/Containerfile
2024-02-15 07:22:38 -08:00

43 lines
1 KiB
Docker

FROM scratch as base
ENV VERSION=6.6
ENV SRC_HASH=d926a06c63dd8ac7df3f86ee1ffc2ce2a3b81a2d168484e76b5b389aba8e56d0
ENV SRC_FILE=linux-${VERSION}.tar.xz
ENV SRC_SITE=http://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/${SRC_FILE}
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch as build
COPY --from=stagex/busybox . /
COPY --from=stagex/musl . /
COPY --from=stagex/make . /
COPY --from=stagex/binutils . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/elfutils . /
COPY --from=stagex/openssl . /
COPY --from=stagex/perl . /
COPY --from=stagex/m4 . /
COPY --from=stagex/gcc . /
COPY --from=stagex/bison . /
COPY --from=stagex/libzstd . /
COPY --from=stagex/zlib . /
COPY --from=stagex/flex . /
COPY --from=stagex/pkgconf . /
RUN tar -xf ${SRC_FILE}
WORKDIR linux-${VERSION}
RUN <<-EOF
set -eux
make oldconfig
make
EOF
FROM build as install
RUN <<-EOF
set -eux
make DESTDIR=/rootfs install
mkdir -p /rootfs/usr
EOF
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package
COPY --from=install /rootfs /