- Joined
- Aug 12, 2023
Containerization is useful for some cases but it gets way overused. Jails (BSD), Cgroups (stuff like Firejail on Linux) are a way lighter way to securely compartmentalize processes without the bloat and overhead of duplicating an entire operating system installation that current containerization solutions require. You have to have a separate rootfs for every container. Either from an image that gets unpacked or from a permanent on-disk rootfs installation, similar to a regular VM, like in LXC. The problem is that this wastes space (hundreds of megs for a minimal OS rootfs just to run a single binary) and introduces massive security problems due to the way these rootfs images are distributed, nearly always precompiled rootfs tarballs that you have no control over that are just downloaded from some cloud server with no integrity checking beyond a https connection and some checksumming. A massive hole for supply chain attacks. Sure, you can build your own images from the ground up, but almost nobody does that, and you can host your own registry server to save images in, and you can enable signing and signature checking (I'm talking primarily about Docker) but that's a ton of work for what's a solution that didn't need to exist in the first place.I never understood why people used docker so much until I read about guix and nix itt. As much as docker is bloat I’m allergic to, this solution sounds worse.
If you have the source to a program, and the program is well written, you could compile it to run with the libraries that are present on your root OS installation, and just use jails or cgroups to isolate it, eliminating the entire supply chain attack surface and bloat that rootfs images bring. But a lot of programs are written like shit, have too strict dependency versions, are written in shit languages that require their own package managers and package distribution systems (like Rust, NodeJS, Golang,...), or many other reasons that are because the program is not written in a portable manner, or is not entirely open source at all.
The solution to that is to only use FLOSS programs that can run on the OS that you're running.
