# This Dockerfile extracts the kernel headers from the kernel image # and then compiles the nvida kernel modules # # see: test/cases/020_kernel/... FROM linuxkit/kernel:4.14.26 AS ksrc # Extract headers and compile module FROM linuxkit/alpine:d307c8a386fa3f32cddda9409b9687e191cdd6f1 AS build #FROM debian:testing AS build RUN apk add build-base libelf-dev xz perl #RUN apt-get update \ # && apt-get install -y build-essential xz-utils kmod libelf-dev COPY --from=ksrc /kernel-dev.tar / RUN tar xf kernel-dev.tar WORKDIR /kmod #COPY ./src/* ./ # um den glibc basierenden installer ausfhren zu können # siehe: https://github.com/sgerrand/alpine-pkg-glibc RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine- pkg-glibc/master/sgerrand.rsa.pub \ && wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.27-r0/glibc-2.27-r0.ap k \ && apk add glibc-2.27-r0.apk # download nvidia installer: # http://us.download.nvidia.com/XFree86/Linux-x86_64/390.42/NVIDIA-Linux-x86_64-390.42.run COPY ./NVIDIA-Linux-x86_64-*.run ./ # --kernel-source-path=`ls -d /usr/src/*` --no-cc-version-check --no-nvidia-modprobe --no-backup --no-opengl-files --no-install-libglvnd --no-glvnd-glx-client COPY ./cuda* ./ # -silent --verbose --driver --toolkit --no-opengl-libs --kernel-source-path=`ls -d /usr/src/*` #RUN make all # Package #FROM alpine:3.7 #COPY --from=build /kmod/hello_world.ko / #COPY check.sh /check.sh #ENTRYPOINT ["/bin/sh", "/check.sh"]