I read often that both concepts are quite different, but I could not find a good explanation about where the differences lie. Both bundle dependencies and restrict talking to the outside world.
When should I pack my app in a container for deployment? When would encapsulated packages be preferable?
Flatpack offers a clues its FAQ includes:
Is Flatpak a container technology?
It can be, but it doesn't have to be. Since a desktop application would require quite extensive changes in order to be usable when run inside a container you will likely see Flatpak mostly deployed as a convenient library bundling technology early on, with the sandboxing or containerization being phased in over time for most applications.
In general though we try to avoid using the term container when speaking about Flatpak as it tends to cause comparisons with Docker and Rocket, comparisons which quickly stop making technical sense due to the very different problem spaces these technologies try to address. And thus we prefer using the term sandboxing.
Is Flatpak tied to Linux?
Yes. We are explicitly using many features of the linux kernel (bind mounts, namespaces, seccomp, etc) to create the sandbox that Flatpak apps are running in. It may be possible to use equivalent technologies on other kernels, but that would be a non-trivial amount of work, and we don't consider this one of our priorities.
A container aims to offer isolation on any system which implements its runc/containerd protocol, and will be soon on Windows as well as Linux.
That differs from software packing format which are quite tied to the OS.
See "Flatpak, Appimage And Snap – How Do They Stack?".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With