Files
linuxkit/test/cases/020_kernel/113_kmod_5.10.x/Dockerfile
Rolf Neugebauer 4eb60514c9 yaml: Update use of alpine:3.11 to alpine:3.13
Seceral YAML files used alpine:3:11. Update them to 3.13

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2021-08-10 00:13:52 +01:00

24 lines
606 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.10.47 AS ksrc
# Extract headers and compile module
FROM linuxkit/kernel:5.10.47-builder 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.13
COPY --from=build /kmod/hello_world.ko /
COPY check.sh /check.sh
ENTRYPOINT ["/bin/sh", "/check.sh"]