mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-05-15 02:37:03 +00:00
By running:
./scripts/update-component-sha.sh --image linuxkit/alpine ad35b6ddbc70faa07e59a9d7dee7707c08122e8d
Signed-off-by: Ian Campbell <ijc@docker.com>
24 lines
616 B
Docker
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.53 AS ksrc
|
|
|
|
# Extract headers and compile module
|
|
FROM linuxkit/alpine:ad35b6ddbc70faa07e59a9d7dee7707c08122e8d 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"]
|