Comment on What's the deal with Docker?
kevincox@lemmy.ml 9 months ago
I feel that a lot of people here are missing the point. Docker is popular for selfhosted services for a few main reasons:
- It is one package that can be used on any distribution (or even OS with a Linux VM).
- The package contains all dependencies required to run the software so it is pretty reliable.
- It provides some basic sandboxing against non-malicious services. Basically the service can’t scribble all over your filesystem. It can only write to specific directories that you have given it access to (via volumes).
- The volume system also makes it very obvious what data is important and needs to be backed up or similar, you have a short list.
Docker also has lots of downsides. I would generally say that if your distribution packages software I would prefer the distribution’s package over the docker image. A good distribution package will also solve all of these problems. The main issue you will see with distribution packages is a longer delay before new versions are made available.
What Docker completely dominates was previous cross-distribution packaging options which typically took one of the previous strategies.
- Self-contained compiled tarball. Run the program inside as your user. It probably puts its data in the extracted directory, maybe. How do you upgrade? Extract and copy a data directory? Self-update? Code is mutable and mixed with data, gross.
- Install script. Probably runs as root. Makes who-knows what changes to your system. Where is the data, is the service running? Will it auto-start on boot. Hope that install script supports your distro.
- Source tarball. Figure out the dependencies. Hope they don’t conflict with the versions your distro has. Set up users and setup scripts yourself. Hope the build doesn’t take too long.
CyberSeeker@discuss.tchncs.de 9 months ago
Sorry if I’m about 10 years behind Linux development, but how does Docker compare with the latest FlatPak trend in application distribution? How you have described it sounds somewhat similar, outside of also getting segmented access to data and networks.
towerful@programming.dev 9 months ago
Docker is to servers, as flatpak is to desktop apps.
I would probably run away if i saw flatpak on a headless server
matcha_addict@lemy.lol 9 months ago
Flatpak has better security features than docker. While its true it’s not designed with server apps in mind, it is possible to use its underlying “bubblewrap” to create isolated environments
kevincox@lemmy.ml 9 months ago
For desktop apps Flatpak is almost certainly a better option than Docker. Flatpak has the same general concepts but Flatpak is more suited for distributing graphical apps.
Generally I would still default to my distro’s packages where possible, but if they are unsuitable for whatever reason (not available, too old, …) then a Flatpak is a great option.