Raw services or in containers?

Hi! I’ve been using my pi4 with diet-pi for a while now and I mostly use it for:

  • plex;
  • pihole;
  • sonarr, radarr, NzbGet;
  • homebridge;
  • vpn;

And some other minor services every now and then. They’re all running purely and directly on the diet-pi image and I’ve been wondering what advantages would I have on using each service on its docket container. Will I gain any benefit?

Thank you!

Not really as your system need to deal with the overhead of the Docker runtime. As well Docker will become a single point of failure. Because if Docker fails to start, all your services will be offline at once. If there is no specific need, you are fine to run your apps natively without Docker.

Thank you, that’s what I thought. However, I’ve been wondering what would be a reliable way to backup my services (for example, if i need to replace/format my OS without losing service states).

Also, sometimes my dietpi freezes and I lose access to all my services which is terrible. For example, right now, I’m out of my hometown and I lose access to plex and my services because some point of failure which I’m yet to discover what is causing it — opened a thread regarding this here

well if your system if freezing with current service, same might happen with Docker as it im impacted by same issue than.

According to the research paper in this SO post, Docker is very efficient and is close to bare metal performance because it’s not a true VM but rather isolator of name spaces.

linux - What is the runtime performance cost of a Docker container? - Stack Overflow

Allow me to gently push back on the “docker as single point of failure” note. That’s also the case for things like ssh, web server(s), and linux in general. In the end, many things can go wrong in various ways and with various levels of severity. If things work out of the box AND only well-tested updates are applied AND no major config changes are made, a system will continue to work just fine. Hardware may wear out or break, but software doesn’t - not from just using it as is, anyway.

Docker is “an extra layer”, which adds complexity (under the hood) and may affect performance.

But “simpler” is not the only metric: e.g. if you need the extra functionality or want to handle more scenarios. Another aspect is how well software is maintained, especially in the long run. Both DietPi and Docker pass with flying colours in this respect, AFAICT. As for the “apps”, that can vary wildly.