Can you run the kernel on real hardware and debug from another PC (automated, either container or not)? Most of the kernel nightmares I've seen and wanted to debug involve drivers (amdgpu sleep-wake GPU hangs, ALSA USB audio setup, touchpad resolution, display backlight PWM frequency), and containers are insulated from physical hardware by design.
Do I build the kernel on the debugging or victim machine, and do I need to use the same distro on both? Does my kernel configuration have to match the victim machine's distro's default settings? How would I get kernel symbols for binary kernels, or transfer symbols from the victim to debugger machine?
There's an interface for debugging many (not all) Intel machines via USB that's been around for years. Needs to be enabled in firmware first, given the obvious security implications.
In a future (very very very future) PR I'd be interesting exploring this idea of building and pushing stuff to a dev-board and debugging it remotely.
However, right now, I don't have any specific use case for this scenario