Files
linuxkit/test/cases/020_kernel/019_kmod_4.17.x/Dockerfile
Rolf Neugebauer 0c631d104f Update YAMLs to latest kernels.
Looks like I missed a few 4.4.x updates to the YAMLs.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2018-07-25 23:02:39 +01:00

24 lines
628 B
Docker

# This Dockerfile extracts the kernel headers from the kernel image
# and then compiles a simple hello world kernel module against them.
# In the last stage, it creates a package, which can be used for
# testing.
FROM linuxkit/kernel:4.17.10 AS ksrc
# Extract headers and compile module
FROM linuxkit/alpine:daed76b8f1d28cdeeee215a95b9671c682a405dc AS build
RUN apk add build-base libelf-dev
COPY --from=ksrc /kernel-dev.tar /
RUN tar xf kernel-dev.tar
WORKDIR /kmod
COPY ./src/* ./
RUN make all
# Package
FROM alpine:3.8
COPY --from=build /kmod/hello_world.ko /
COPY check.sh /check.sh
ENTRYPOINT ["/bin/sh", "/check.sh"]