🐳 Bring in module-loader Dockerfile

This commit is contained in:
M. Mert Yildiran 2023-08-10 23:50:53 +03:00
parent 7c8adee7a8
commit cc78b291af
No known key found for this signature in database
GPG Key ID: DA5D6DCBB758A461
2 changed files with 38 additions and 0 deletions

33
module-loader/Dockerfile Normal file
View File

@ -0,0 +1,33 @@
### Builder image
ARG TARGETARCH=amd64
FROM ${TARGETARCH}/debian:bullseye AS builder
ARG KERNEL_VERSION
RUN apt-get update
RUN apt-get install -y -q \
curl \
build-essential \
linux-headers-${KERNEL_VERSION}
WORKDIR /work
RUN curl https://github.com/ntop/PF_RING/archive/refs/tags/8.4.0.tar.gz -Lo ./pfring.tar.xz && \
tar -xf pfring.tar.xz && \
mv ./PF_RING-* ./pfring
WORKDIR /work/pfring/kernel
ENV KERNELRELEASE=${KERNEL_VERSION}
RUN make
### The shipped image
ARG TARGETARCH=amd64
FROM ${TARGETARCH}/debian:bullseye
ARG KERNEL_VERSION
RUN apt-get update && apt-get install -y kmod
COPY --from=builder /work/pfring/kernel/pf_ring.ko /opt/lib/modules/${KERNEL_VERSION}/
RUN depmod -b /opt ${KERNEL_VERSION}

5
module-loader/build-push.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
set -e
# Build it on x86_64
docker build . -t kubeshark/module-loader:latest --build-arg KERNEL_VERSION="5.10.0-23-amd64" && docker push kubeshark/module-loader:latest