I think, if all that you want is netbooting ISOs, then you can probably get away with it being reasonably self-contained.
Fundamentally, its just a TFTP server serving up the pxelinux ‘bootloader’, and the pxelinux bootloader will then fetch the .cfg
files you have over at the TFTP server, and from there you can really do whatever you want (since pxelinux knows about http, tftp, whatever.)
You can server the ISO files over http (or the same TFTP server as the pxelinux, but TFTP can be quite slow in my experience) from the same container, or if your kernel is advanced enough, it can just pull the ISOs from a http url as is the case with the ubuntu server distro.
The big annoyance I found was having to have the dhcp tftp boot parameters setup in my DHCP/router config. I’m using MikroTik hardware (still not sure if this was a good investment), so unless your dhcp server is already in a docker container, you’ll have to keep your dhcp config maintained in parallel.
The worst part by far though, is that you will be at the mercy of the first stage bootloader of whatever hardware you’re trying to netboot. and ofcourse they are all very different. I had a 32-bit x86 box append a 0xFF
byte at the end of the TFTP boot filename before it fetched it, which I had to work around by manually putting a zero-byte at the end of the TFTP boot filename to act as a NUL
terminator. How did I discover this? Port mirroring on my router, and then doing wireshark packet analysis. Well, I suppose I atleast learned something new.
run-of-the-mill 64 bit UEFI stuff I found more well behaved, but I still had to fiddle with the BIOS to explicitly enable boot over LAN.
I still haven’t got the RPi4 bootloader to respect by DHCP TFTP server address option. I ended up having to manually specify the TFTP address and then flashing the firmware, similar to how this guide demonstrates. Only then did it go over the cable to fetch the kernel image over TFTP. I know its my own fault for not providing what the RPI4 bootloader wants, but finding out exactly what it wants is quite hard. Come to think of it, I think the source code should be available somewhere.
The other major pain point is the sea of arcane DHCP option parameters. there are hundreds of them, and god knows what your particular first-stage ROM bootloader happens to honour, and what it ignores. Thankfully the TFTP ones are fairly obvious, but PXELINUX uses some of its own for paths and stuff.
The DHCP handbook has useful stuff about this.
P.S. that LTSP project does look worth a try, to avoid all this nonsense.