iximiuz / docker-to-linux

Make bootable Linux disk image (ab)using Docker
https://iximiuz.com/en/posts/from-docker-container-to-bootable-linux-disk-image/
659 stars 92 forks source link

[Question] Scratch images #13

Closed Zekfad closed 3 years ago

Zekfad commented 3 years ago

Hi, this project looks great, and I'm curious if it's possible to run scratch images same way? Let's say pure c printf to terminal and infinity loop, or just a standalone web server with all required dependencies included, excluding systemd and other unnecessary parts?

iximiuz commented 3 years ago

Hi Yaroslav! I think what you're asking for is technically doable. All you need is to bundle the kernel binary with your application binary (assuming all the dependencies are statically linked). Then pack it into a thin image and boot from it. However, this particular project wouldn't be helpful given its current functionality. It relies heavily on the standard distr tools to bring in the kernel binary. And you need rather an inverse tool.

Zekfad commented 3 years ago

Thanks for your reply! Do you have any suggestions where can I get more related information?

iximiuz commented 3 years ago

I haven't made much research yet, but here are some items from my list that you may find interesting: