Skip Navigation

Am I wrong to assume that docker is perfect for single board computers that relies on low life expectancy drives (microsd)?

Title. Mostly because of two flags: --read-only and --log-driver.

14
14 comments
  • I'm not sure why Docker would be a particularly good (or particularly bad) fit for the scenario you're referring to.

    If you're suggesting that Docker could make it easy to transfer a system onto a new SD card if one fails, then yes that's true ... to a degree. You'd still need to have taken a backup of the system BEFORE the card failed, and if you're making regular backups then to be honest it will make little difference if you've containerised the system or not, you'll still need to restore it onto a new SD card / clean OS. That might be a simpler process with a Docker app but it very much depends on which app and how it's been set up.

  • honestly, it's not worth it. hard drives are cheap, just plug one via USB 3 and make all the write operations there. that way your little SBC doesn't suffer the performance overhead of using docker.

  • I use docker myself on my RPi4, but the OS is on a 128 GB SSD connected through USB3. These SSD are pretty cheap nowadays and (likely?) more resilient than sdcards...

  • Unless you make your host OS read-only, it itself will keep writing while running your docker containers. Furthermore slapping read-only in a docker container won't make the OS you're running in it able to run correctly with an RO root fs. The OS must be able to run with an RO root fs to begin with. Which is the same problem you need to solve for the host OS. So you see, it's the same problem and docker doesn't solve it. It's certainly possible to make an Linux OS that runs on an RO root fs and that's what you need to focus on.

  • I think Docker is a tool, and it depends on how you implement said tool. You can use Docker in ways that make your infra more complicated, less efficient, and more bloated with little benefit, if not a loss of benefits. You can also use it in a way that promotes high uptime, fail-overs, responsible upgrades, etc. Just "Docker" as-is does not solve problems or introduce problems. It's how you use it.

    Lots of people see Docker as the "just buy a Mac" of infra. It doesn't make all your issues magically go away. Me, personally, I have a good understanding of what my OS is doing, and what software generally needs to run well. So for personal stuff where downtime for upgrades means that I, myself, can't use a service while it's upgrading, I don't see much benefit for Docker. I'm happy to solve problems if I run into them, also.

    However, in high-uptime environments, I would probably set up a k8s environment with heavy use of Docker. I'd implement integration tests with new images and ensure that regressions aren't being introduced as things go out with a CI/CD pipeline. I'd leverage k8s to do A-B upgrades for zero downtime deploys, and depending on my needs, I might use an elastic stack.

    So personally, my use of Docker would be for responsible shipping and deploys. Docker or not, I still have an underlying Linux OS to solve problems for; they're just housed inside a container. It could be argued that you could use a first-party upstream Docker image for less friction, but in my experience, I eventually want to tweak things, and I would rather roll my own images.

    For SoC boards, resources are already at a premium, so I prefer to run on metal for most of my personal services. I understand that we have very large SoC boards that we can use now, but I still like to take a simpler, minimalist approach with little bloat. Plus, it's easier to keep track of things with systemd services and logs anyway, since it uniformly works the way it should.

    Just my $0.02. I know plenty of folks would think differently, and I encourage that. Just do what gives you the most success in the end 👍

  • I don't use those two flags, but have several pis running docker with no issues. They've been running (almost) 24/7/365 going on maybe 2 years now with the same sd cards.

14 comments