Files
linuxkit/test/cases/020_kernel/102_kmod_4.14.x/Dockerfile
Rolf Neugebauer dfc605d703 Update kernel test YAMLs to the latest kernels
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2020-03-28 12:01:50 +00:00

24 lines
631 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.14.174 AS ksrc
# Extract headers and compile module
FROM linuxkit/alpine:3fdc49366257e53276c6f363956a4353f95d9a81 AS build
RUN apk add build-base elfutils-dev
COPY --from=ksrc /kernel-dev.tar /
RUN tar xf kernel-dev.tar
WORKDIR /kmod
COPY ./src/* ./
RUN make all
# Package
FROM alpine:3.9
COPY --from=build /kmod/hello_world.ko /
COPY check.sh /check.sh
ENTRYPOINT ["/bin/sh", "/check.sh"]