Files
linuxkit/test/cases/020_kernel/010_kmod_4.9.x/Dockerfile
Rolf Neugebauer 4866a1c4d6 Update YAML files with latest kernels
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-11-03 15:11:07 +00:00

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