Because I hate Electron
Docker, Distrobox, Toybox, systemd-nspawn, chroot.
Technically those all rely on the same kernel namespace features, just different ways to use it.
That’s also what Flatpaks and Snaps do. If you only care about package bloat, an AppImage would do too but it’s not a sandbox like Flatpak.
Don’t use docker with distrobox. Use podman instead as it is rootless and faster
IIRC that’s the whole point of flatpak, snap and appimage
Docker can probably do it too, distrobox puts a useful wrapper on that
Nix does that kind of, nix packages aren’t isolated in that they can’t access resources on your system but all dependencies are stored in the nix store, hashed and isolated from eachother, and wiped when you collect garbage
Appimage doesn’t do deduplication of packages does it?
No, I apparently missed that but
Nix is the best solution anyway imo
Go with one of the ready to use systems. Flatpak, Snap, AppImage. Snap is largely Ubuntu Ecosystem, Flatpak is independent. AppImage is an option if you do not need/want a Sandbox.
Stay away from Docker and LXC for this use case (graphical applications), they are much more work to get going.