Post by @mhoye@cosocial.ca

mcc
@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)

Replying to @mcc@mastodon.social
mhoye
@mhoye @cosocial.ca

@mcc The thing that gets me is... you don't.

Service instances don't need 'linux', they need a rigorously pruned system that effectively cuts the whole system down to a core microkernel that only supports what the service needs and precisely nothing else.

It's the human experimenting with new ideas that needs the flexibility and extended software ecosystem that makes up linux. And somehow the Linux kernel and the most important project in the linux userspace have stopped believing that.

Replying to @mhoye@cosocial.ca
mcc
@mcc @mastodon.social

@mhoye Well, I need a distribution. I'm not making my own distribution, and if I am it's going to be a distribution of Redox or something greenfield. Do you hvae have a suggestion for a "rigorously pruned system", or are you bemoaning that none currently exists you find adequate?

Replying to @mcc@mastodon.social
Rachael L
@r343l @freeradical.zone

@mcc @mhoye Wait, are their docker / podman / whatever images that run that aren’t some kind of (possibly stripped down) posix-ish system? Basically the most stripped down containerized thing I’ve experienced is alpine which is still Just Linux albeit one that by default does NOT come “batteries included” so to speak.

Nicolás Alvarez
@nicolas17 @treehouse.systems

@r343l @mcc @mhoye as an example, a statically-linked Go application could run in a docker image that has literally nothing else in it, not even libc

Replying to @mhoye@cosocial.ca
mcc
@mcc @mastodon.social

@mhoye @nicolas17 @r343l I'm actually a little confused how this works ultimately. Is the idea that a statically linked application engages with the outside world only through syscalls, and the syscall interface is stable? How does this work if you need to use the video card? I could be wrong but I thought video card support had userland components which vary from machine to machine and so can't per se be statically linked.

Replying to @mcc@mastodon.social
Nicolás Alvarez
@nicolas17 @treehouse.systems

@mcc @mhoye @r343l yeah if you need to talk to the GPU you pretty much have to dynamically link to the userland part of the GPU driver.

Daniel Lakeland
@dlakelan @mastodon.sdf.org

@nicolas17 @mcc @mhoye @r343l

Well, and what about networking? Ethernet card, routing, qdisc, nftables, etc all require a linux kernel. we aren't yet at the place where even if you just want a server you can run a static linked binary on top of XEN or something right?

Nicolás Alvarez
@nicolas17 @treehouse.systems

@dlakelan The syscall ABI for networking is stable in a way GPU isn't. I was never talking about getting rid of the kernel.

Replying to @mcc@mastodon.social
Dave Rahardja
@drahardja @sfba.social
Public en edited

@mcc @mhoye @nicolas17 @r343l You can in theory make a statically linked binary that makes nothing but syscalls, but in practice you’d only be able to run it on that one hardware/software config (or until such time that the syscalls no longer work). Then you’d have to rebuild it with a matching SDK.

Replying to @mcc@mastodon.social
Glyph
@glyph @mastodon.social

@mcc @mhoye @nicolas17 @r343l short version, you memorize which pieces of userland are required, then you put them in the container. (then you give the container a zillion extra permissions so those userland pieces can violate all the isolation). sometimes you have to expose some device files via a mount too.

Replying to @mhoye@cosocial.ca
Nicolás Alvarez
@nicolas17 @treehouse.systems

@mhoye @r343l @mcc yes 😅 I guess I should have said "statically linked binaries such as Go web apps" which is where I have seen the "single file docker image" thing done most often.

mcc
@mcc @mastodon.social

@nicolas17 @mhoye @r343l i mean, it *is* true that Go and Rust "prefer" static linking in a way some other languages don't.

Replying to @mcc@mastodon.social
Nicolás Alvarez
@nicolas17 @treehouse.systems

@mcc @mhoye in Rust you still dynamically-link to libc.so to interact with the operating system (by default at least).