Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

systemd is far superior to anything else out there. It matured at roughly the same time as docker.

However it doesn't support being the CMD in a Dockerfile. Which is why it's not very common in software deployment scenarios in the post-container world.

For older deployments, it may not be worth switching to systemd because the base OS may not be compatible.

So it's kind of a catch-22.

If you are on baremetal, systemd is much preferable to run it/supervisord



> However it doesn't support being the CMD in a Dockerfile. Which is why it's not very common in software deployment scenarios in the post-container world.

Er, that's only half-true. systemd isn't great for running as PID 1 inside a Dockerfile, but that's because Docker already monitors PID 1[0], and systemd can be used to monitor your container itself.

In other words, think of containers as individual applications that you want to monitor, and systemd can be used either to monitor them or even to run the containers directly. (Yes, systemd can even run Docker containers directly, without Docker![1])

[0] you are using exec mode, right?

[1] https://chimeracoder.github.io/docker-without-docker/#1


Actually I'm not sure we are referring to the same thing here.

I'm referring to pid1 inside the docker container. systemd does not run inside the container as pid1 very easily.

Take a look at this - https://github.com/docker/docker/pull/13525

I think your presentation was about replicating docker functionality using systemd-nspawn...Which pretty cool...But it's not the same as what I'm talking about.

I'm referring more generally to production decisions with docker. Also read this https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zomb...


> Actually I'm not sure we are referring to the same thing here. I'm referring to pid1 inside the docker container. systemd does not run inside the container as pid1 very easily.

We are - I'm saying that you don't actually want to run systemd as PID 1 inside a Docker container; the Docker model is built around the container being an application unit, not a system unit.

But if you want to have isolated system(d) units, you can use systemd to get that behavior inside containers. In that case, you'll want to use systemd to run your containers instead of Docker, because systemd's tooling is container-aware (ie, you can have integration between units that run on your host and units that run inside a machine - 'machine' being the systemd term for 'container', in this case).


That is a simplification - even Facebook runs sshd inside its containers.

I know what you are saying - that an atomic unit of work is the program itself..But we run stuff under supervisord even if it is a single program. It helps us to make quick debugging changes to scripts,etc and "restart" them without restarting the container.

In theory it seems the same - in practice it is not. This is the reason for the existence of tons of different init tools for docker.

BTW, I had trouble understanding what you meant because you are constantly moving from docker-as-an-application-unit concept (which is reasonably true) to systemd-nspawn-is-better-than-docker (which is something I am not generally opinionated about).


> It matured at roughly the same time as docker.

Docker, "matured", in past tense? Proof of time travel right there!


Systemd works inside LXC and systemd-nspawn.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: