3 ms·
> In a VM image, you need a "minimal OS" which has to include the kernel, drivers, required OS binaries + everything that would be in a container. A docker ima
by ciprian_craciun 5y ago
> In a VM image, you need a "minimal OS" which has to include the kernel, drivers, required OS binaries + everything that would be in a container.
A docker image and a VM image can be the same.
For example say you have a simple web server that just listens on port 443 and does it's thing; if you compile it statically, and it doesn't need any other files, you don't even need a VM image.
You can simply create an initramfs that contains that executable (nothing else, no drivers, no configuration files, no distribution, nothing).
Just boot the Linux kernel (granted, a custom build that uses built-in modules that the hypervisor actually uses), use proper kernel arguments to either statically or dynamically configure the network stack, and instruct the kernel to use the server executable instead of the `init`. Your server doesn't even know it's running in an "empty" VM.
(Just read about how AWS Lambda implements everything by using Firecracker.)