Post by @mdione@en.osm.town

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
Marcos Dione
@mdione @en.osm.town

@mcc I sincerely don't want to mansplain anything here, but reading your concerns I will pick them up and try to answer them. Fell free to mute me.

And I will start with a question for you:

> Why the fuck do I need Linux if I have docker?

Do you mean outside or inside the container? And in the case of outside, do you mean just the kernel (as opposed to a *BSD or MacOS), or the GNU/Linux[1] concoction?

[1] No, I'm no longer a RMS fan, but in this case it's relevant.

1/

Replying to @mdione@en.osm.town
Marcos Dione
@mdione @en.osm.town

@mcc

> Could vim, and man, and gcc, be a container?

> What if I put the tooling inside its own container and therefore the attackers can't use it because they're not in that container

Yes, but you will have to (ab)use volumes a lot to make everything useful. And unless you count container breaches, the host OS is almost as unreachable as a sibling container.

2/

Replying to @mdione@en.osm.town
Marcos Dione
@mdione @en.osm.town

@mcc

> what is the Linux distribution itself providing?

Depending on the distro, security fixes, as opposed to new releases with new (and possibly buggy) features.

> I'd worry about all these docker images increasing that

yeap, each docker image is basically pulling all the basic libraries again and again: libc/musl, libssl, libz, etc. And depending on how those images are built, with different versions and different security update policies.

3/

Replying to @mdione@en.osm.town
Marcos Dione
@mdione @en.osm.town

@mcc

> docker *replaces* systemd? I no longer configure, start or stop systemd services, just docker images with services inside them?

Kinda. It's like using pip instead of apt. Docker will remember the container s it has running and would restart them on a reboot. I'm not 100% sure it has the same level of service lifecycle handling as systemd (f.i., restart on failure, unless it keeps crashing at boot, etc).

4/

Replying to @mdione@en.osm.town
Marcos Dione
@mdione @en.osm.town

@mcc

> "can't ssh in" is kind of a no-go for me, depending on what that means. i routinely edit html files in vim…?

You don't really run ssh in the containers; the idea is that they're single processes. If you want a whole GNU/SystemD/Linux system, then Incus (as suggested elsewhere) is the only one I used (besides full VMs) that does it.

5/

Replying to @mdione@en.osm.town
Marcos Dione
@mdione @en.osm.town

@mcc Also, you're not supposed to touch the containers. If you're serving HTML files, you will probably want to put those in a directory on the host and mount them in the container as a volume. It's the same with database data directories and anything you want to survive a container restart.

6/

Replying to @mdione@en.osm.town
Marcos Dione
@mdione @en.osm.town

@mcc

> people complain about docker "only being able to inherit from one other" container specification

Yeah, the idea is that you could not mix several images into a single one, more like multiple inheritance or mixins in OOP languages, if that helps.

7/

Replying to @mdione@en.osm.town
Marcos Dione
@mdione @en.osm.town
Public en edited

@mcc

> I was told tonight docker-compose.yaml comprises a "container" which can compose a number of "images"

Compose allows you to declare several services and connect them in a single file, so you could have an HTTP server, a DB and the service in 3 containers, and be able to connect them (via their ports) there, in a more coherent way (but not, for instance, if you had several web services that use the same DB engine, unless you declare them all in the same compose).

/end