Files
linuxkit/test/cases/020_kernel/017_kmod_5.0.x/Dockerfile
Rolf Neugebauer 3df49b9727 tests: Add tests for the 5.0.x kernel
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-03-10 23:29:48 +00:00

24 lines
626 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:5.0.1 AS ksrc
# Extract headers and compile module
FROM linuxkit/alpine:5ce235f4fb55772e7f78871a70bfe26f774fe2b0 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.9
COPY --from=build /kmod/hello_world.ko /
COPY check.sh /check.sh
ENTRYPOINT ["/bin/sh", "/check.sh"]