I have two linux kernels installed on my machine: 5.15.0-52-generic and 5.15.73-rt52. The rt52 kernel is a kernel patched with PREEMPT_RT. When I boot into the PREEMPT_RT patched kernel and build a docker image, only the headers for 5.15.0-52-generic are copied into /usr/src in the image. On the host there are files for both 5.15.0-52-generic and 5.15.73-rt52 kernels in /usr/src. Why is Docker copying the wrong headers and how can I make it either copy all headers or copy the headers that are related to the kernel that I'm currently running on?
Asked
Active
Viewed 85 times
0
-
Why do you need kernel headers in your image? Normally Linux capabilities prevent you from directly interacting with the kernel, and a kernel can be so incredibly host-specific that building tight kernel dependencies into a reusable image doesn't work well. – David Maze Nov 04 '22 at 10:10
-
I need to build a kernel module in the docker image. Specifically, I'm using NI-RIO drivers (https://www.ni.com/pdf/manuals/378684a.html) to communicate with NI FPGA device. The image only needs to work on the specific computer. – Alqio Nov 04 '22 at 10:22