Post by @mcc@mastodon.social
So I got today a pretty aggressive sell for moving all my online services to Docker [or podman, whatever, IDK]. Which is something I was already considering for security reasons, but it was argued to me some of the advantages of nix/guix I was interested in (clear separation of content, configuration, and software on my server, easy redeployment) I could get with just Docker.
Okay. Actually this all made sense. But now I have a question.
Why the fuck do I need Linux if I have docker? (1/3)
Put a different way, I've got a couple VPSes. I've got services/sites running on each one. Each is hard nailed to the VPS it's running on. In the docker/podman world I guess I'd have a container for each of my sites (hopefully I don't need an nginx for each site), and a container for mysql or something, and a container for the two non-apache app servers I run. That's… everything I do on the VPS, except log in and fuck around with vim. Could vim, and man, and gcc, be a container? (2/3)
And then what is the Linux distribution itself providing? I just need it to launch and supply kernel+systemd, right? (My VPSes are VERY low disk, low RAM— so I'd worry about all these docker images increasing that.) Wouldn't it make sense to use a distribution that does NOTHING else? Like… uh… examples Kagi gives are "CoreOS" and and something discontinued, and maybe Alpine, though I thought Alpine was about Musl. Assume I actively distrust Redhat. What's the *smallest* podman-host Linux? (3/3)
Other, weirder questions:
- I keep hearing people complain about docker "only being able to inherit from one other" container specification. I was told tonight docker-compose.yaml comprises a "container" which can compose a number of "images" (make fun of me for not knowing these basic things if you wish; I learned Linux in 1998, and nothing changes that). What is the single-inheritance rule, if it's real, concerning? The container? Image specifications? Is podman different in this sense? (4/3)
- What the fuck is Oracle https://docs.oracle.com/en/operating-systems/oracle-linux/podman/containers.html#containers trying to say in this screenshot?
- What does podman use instead of a docker-compose file? Does it just use docker-compose? This doc https://docs.podman.io/en/latest/markdown/podman-compose.1.html says it has the option of using "podman-compose". If I Kagi for that, I get… that same link, the podman-compose manpage (the dash being only a manpage convention).
MUST I write YAML files? Terrifying. I need structural editors for LISP and YAML so I don't have to touch them directly (5/3)
Somewhat distressed as my reason for even considering this was I was thinking "if I use docker/podman, I get nix/guix plus a security isolation layer!" and here I have many responses saying "do not use docker as a security isolation layer". Well wtf do I use if I want a security isolation layer then (6/3)
Okay. Let me ask the question in the above post a little more clearly:
If someone says "podman is not a security isolation boundary", do they mean anything more or less than "if the kernel has privilege escalation vulns, then the kernel has privilege escalation vulns"?
(Clarifications: When I say "podman" in this post, I mean "podman", not "docker"; also, I am reading that podman uses SELinux, but I'm not clear if it ALWAYS uses SELinux or uses it 'in some configurations'. I know nothing)
@kouhai Thank you. Next question: Does the "some configurations" for podman with SELinux meaningfully constrain my choice of linux distribution?
@mcc I recently set up podman. by default the daemon is configured to run as root. it is possible, but surprisingly hard, to comfigure it to run as less than root. so, anyone who needs to start a container can also use the daemon to pivot into root. this is a Linux thing, I do not know why this is the default config. it was a few months ago so I am likely wrong on details but it differs a lot from e.g. docker desktop on macOS where containers run inside a vm under your user.
On the security question: _basically_ that, but also: not everything gets namespaced, and actual device files get mapped in. And often one ends up giving the container capabilities which are effectively root equivalent.
If you do end up using the systemd "quadlet" approach, there's a bunch of stuff which you can tighten as you like.
@mcc "docker|podman is not a security boundary" is typically followed with a sales pitch for a cloud vendor's hardened container runtime - AWS firecracker/fargate, GCP gvisor.
Which is to just say that you can run docker engine/podman out of the box and have it be a weak security boundary, and then later change it to be better without affecting your workload inside the container.
@mcc Generally Podman is just better in security because it is based on default privileges by the current user.
There is no root daemon like dockerd for Docker running the service, and podman uses a rootless privilege model (as described above).
So even if it isn't using SELinux in some configurations, it is exceptionally much better than Docker in terms of security.
I am also attracted to podman more because it is community driven rather than business driven like Docker.
@mcc I think the security boundary argument is exactly that you are sharing a kernel, and I went from "that's being paranoid" to "okay maybe it's a valid point" with all the vulns coming out.
krun is an interesting approach for VM-ising your podman container without changing much for common cases.
Also, the nix ecosystem has ways to generate Docker/OCI images, so you can have the best of both worlds if you want.
@mcc basically it’s a really big attack surface and the kernel namespace features are primarily designed to prevent non-malicious apps from interfering with each-other.
@mcc An important part of the "insert container runtime here is not a security boundary" story goes in the opposite direction of what some of the replies here have gestured at - namely, something like the following:
Assume that there exist certain privilege-escalation vulns in the kernel. (A fairly solid assumption here in late 2026, lol.)
Assume that those cannot be accessed through, I dunno, straight-up SSH into the box where that kernel runs, but instead require an app to be running there that itself has some vuln that allows you to go from
app listens for HTTP traffictoapp executes arbitrary code in userspacetoarbitrary code exploits kernel privilege-escalation vuln.Now, if that app is running in a container, and on the same machine, you're running another app, in a different container, that second app is still every bit as vulnerable to this attack vector as it would be if the two apps were running directly, not containerized, on the host box. (I.e., you can compromise the kernel from one app, and use that access to mess with the second app, regardless of the container boundaries.)
Now, depending on one's understanding of kernels, containers, etc., the above might seem rather trivial. But you'll be surprised how many not-completely-technical people are surprised by this reality (that one app can compromise another app this way, even when they are both containerized). So a cynic might say "a compromised kernel is a compromised kernel, duh"; the point here can be summarized as "when an attack vector transits through the kernel, containerization will do nothing for you, security-wise."
(Sorry for the super-long poast.)
@io hmm but a linux distribution which is not using containers is under typical default settings susceptible to *additional* vulnerabilities that do *not* rely on the existence of a kernel privilege escalation. and those additional vulns may be harder to address than a kernel vuln (ie a kernel vuln requires simply for LKML to be good at addressing vulns and you to be good at patching them, whereas issues further up the abstraction stack may involve complex logistics like library supplychains)