Dockerfile: fix kernel & initrd cross-compilation#82
Dockerfile: fix kernel & initrd cross-compilation#82akerouanton merged 2 commits intocontainerd:mainfrom
Conversation
Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com>
Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com>
There was a problem hiding this comment.
Pull request overview
This PR enables cross-compilation of the kernel and initrd by automatically detecting architecture mismatches and configuring the appropriate toolchain. The changes ensure that the kernel, init binary, and crun runtime are compiled for the target architecture rather than the host architecture.
Key changes:
- Added automatic installation of cross-compiler toolchains when host and target architectures differ
- Configured kernel compilation with proper
ARCHandCROSS_COMPILEenvironment variables for cross-compilation - Leveraged Buildkit's
TARGETARCHvariable to download the correct crun binary and compile the init binary for the target platform
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
sigh, hi @akerouanton I really hope #61 could be addressed. |
|
@hsiangkao can discuss in that issue, the cross compilation is not very easy right now. Some components cannot be compiled easily on Linux and some components cannot be easily compiled on Mac. |
ARCHandCROSS_COMPILEduring kernel compilation, by comparing current arch with the suplliedKERNEL_ARCH.TARGETARCHto determine which version of crun should be downloaded, and compile the init binary for the correct architecture.