4 ms·
I actually like the idea of Docker as a better systemd (or rather, the interface is better). No bespoke file format, programmable API, no need to google for the
by throwaway894345 6y ago
I actually like the idea of Docker as a better systemd (or rather, the interface is better). No bespoke file format, programmable API, no need to google for the right journalctl switches, and then of course the advantages of containers and images over processes and system packages. I’m not suggesting everything should be a container nor that docker is the ideal implementation, but it certainly points in the right direction.
- Spivak 6y agoBut systemd has all of those things. Everything in systemd can be orchestrated with dbus. In fact that’s all systemctl really is — a dbus client. And the file format is ini. And shell style environment files if you want. And systemd actually comes with two image launching systems systemd-nspawn and systemd-portable. And then with systemd-machined you can add software that needs virtualization too. The interface to journald is more complicated than it should be but it’s also really powerful — docker logs doesn’t hold a candle to the kind of filtering it can do. Overall systemd is a stupidly powerful and featureful supervisor compared to Docker. Just the dependency management alone should demonstrate that. Then you get mounts, swap, socket activation, more powerful restarting policy and the whole suite of isolation and security features.
- deckard1 6y ago> The interface to journald is more complicated than it should be but it’s also really powerful I thought the point of logging to stdout (i.e. docker logs) is that you just take that output and dump it to another server for processing and filtering. journald/journalctl seem to be a solution a few decades late to the party. For a single user machine or a single app prod environment, I would take a plaintext log any day of the week. At least I can remember how to grep the damn thing. And then when you get to a distributed system, what's the point of journalctl? You would hopefully have all of that logging aggregated together in one place with a much nicer web interface for it all.
- throwaway894345 6y agoExactly this. I just want a stream of logs that I can process with ordinary unix tools without jumping through hoops. I don’t need any extra power for its own sake.
- Spivak 6y agoIf that’s all you want there’s really no hoops. journalctl | grep Does what you would expect, it will happily (and by default on most distros) forward to syslog if you want files. The big ease-of-use win for journald is that it captures process stdout. No need to run daemons in the foreground ever.
- throwaway894345 6y agoclose, but it’s actually sudo journalctl -u $service -f | grep Not a huge deal, but I have to google it every few months because I don’t use it very often. Note also that if I just want the log stream, I have to pipe through less to get the full log messages. There’s also a flag for it, but I can’t remember my workaround is easier than digging through man pages. Again, no big deal, just friction. Like everything in the systemd ecosystem—everything is manageable, but it’s tedious.
- Grollicus 6y agoLast time i did look into docker it couldn't even tell if a service is up or still starting and there were all kinds of weird hacks around that like "is something listening on the configured port". Did that improve?
- dumpsterdiver 6y agoSystemd struggles with this as well. While a service can easily tell you if it's "up", sometimes the only way to determine if it's "available" is to check. Keep in mind that the sentinel for any given service will be different. If you think about it, how could any external monitoring service determine when a service under it's purview is available without actually checking? Maybe it already has something like this, but I feel like systemd could provide an API endpoint for applications to send a simple status when they are "ready" - at which point it would be up to the developers to provide that at the right time.
- lloeki 6y agoAm I understanding this wrong or is HEALTHCHECK supposed to enable that? https://docs.docker.com/engine/reference/builder/#healthcheck https://docs.docker.com/engine/reference/builder/#healthchec...
- joana035 6y agoHere you go: https://www.freedesktop.org/software/systemd/man/systemd-notify.html https://www.freedesktop.org/software/systemd/man/systemd-not...
- dumpsterdiver 6y agoFrom the link: "systemd-notify may be called by daemon scripts to notify the init system about status changes. It can be used to send arbitrary information, encoded in an environment-block-like list of strings. Most importantly, it can be used for start-up completion notification." Perfect. Thank you!
- 6y ago
- joana035 6y ago> I actually like the idea of Docker as a better systemd (or rather, the interface is better). No bespoke file format, programmable API, no need to google for the right journalctl switches, and then of course the advantages of containers and images over processes and system packages. I’m not suggesting everything should be a container nor that docker is the ideal implementation, but it certainly points in the right direction. Docker was created to give an extra life for legacy applications depending on outdated packages, the concept of gluing all dependencies withing a compressed rootfs and shipping that, with low effort. Docker became popular because of that, but seems that did more harm than good for the ecosystem in terms of security, that why podman might have a great future. The docker interface is bad and comparing that with systemd is quite a stretch. ;) Anyhow, aren't systemd units ini files? The journalctl ships with man pages though. Aren't containers just processes with namespaces and cgroups?
- mbakke 6y agoHow does podman improve on container ecosystem security?
- throwaway894345 6y ago> The docker interface is bad and comparing that with systemd is quite a stretch. ;) I don't know, systemctl is always a pain to interact with. The Docker CLI is pretty intuitive--you have different resources and different verbs for interacting with those resources. This includes logs. No need to use a separate (and confusing) tool nor dig through man pages. I'm of the philosophy that it's better for a tool to be intuitive than obscure-but-has-manpages. > Anyhow, aren't systemd units ini files? The journalctl ships with man pages though. I guess I meant that INI isn't a standard file format--different parsers behave differently, and structured data is often coded in strings in some bespoke format. > Aren't containers just processes with namespaces and cgroups? My mind isn't made up that containers are the ideal process unit, but I do like some things about them (and the container ecosystem more generally). That they come with their dependencies bundled is pretty nice, but I think the toolchain needs to improve to mitigate security concerns and so on. Something like Nix would be helpful, but Nix also has its own problems. Again, it's directionally correct. In any case, users don't need to be managing their own namespaces and cgroups.
- yjftsjthsd-h 6y agoHow are you using Docker that doesn't need a bespoke file format? You're building from a Dockerfile and either scripting around the docker command or running docker-compose.yml
- throwaway894345 6y agoCompose
- yjftsjthsd-h 6y agoI would argue that docker-compose.yml is every bit as bespoke as a systemd service file (so, "medium"; a custom schema embedded in yaml/INI).
- throwaway894345 6y agoLike I said, I don’t actually want docker or docker compose, but they are directionally correct. Notably YAML over INI is a nice improvement. Also, that the docker daemon has a real API and not just dbus.
- m463 6y agoIt now becomes clear that podman is a new way of folding docker into systemd. at some point systemd is an embrance-and-extend formula to control the linux ecosystem
- thu2111 6y agoWell, Docker has an API and its own file format (the Dockerfile), I constantly have to look up Docker switches as it's not a tool I use every day and it's not at all intuitive, and I'm still unclear why people love this layered/stack image approach given how unbelievably slow it makes everything. Apps that would once have been a 50mb tarball are now routinely a gigabyte of downloads, perhaps because whatever random version of Ubuntu I downloaded previously is now slightly different? Who knows. There is, frankly, a lot of appeal to me in a simple INI file that starts up something I unzipped.