Hacker News new | ask | show | jobs
by zodiakzz 1615 days ago
I miss Systemd inside Docker containers so much. IMO, for an app, "one-process per container" is a huge pain and very messy. I have a massively popular software to back up that claim: https://github.com/discourse/discourse_docker

I use phusion/baseimage-docker[1] right now, love every bit of it. Having the database, web server(nginx) and the java backend all in one place works beautifully.

The only pain point is having to write `runit` scripts for startup and shutdown for each service, hence the wish for Systemd inside containers.

1: https://github.com/phusion/baseimage-docker

3 comments

Podman supports running systemd units inside containers: https://developers.redhat.com/blog/2019/04/24/how-to-run-sys...

One process per container is indeed strange in a lot of use cases, you lose the self-contained advantage of a container...

Thank you for that link. That is eye opening.
You can use systemd inside Docker containers. There are images (like RedHat's ubi8-init) which start systemd by default, and there are others which can be easily adapted to start systemd (for instance, the following 3 lines for a Debian image which starts systemd: "FROM debian:10", "RUN apt -y update && apt -y install systemd-sysv", "CMD ["/sbin/init"]").
Have you tried nspawn? Its part of systemd and integrates beautifully with the rest of systemd (for things like journald, networking, etc.) and is basically meant for what you requested.