You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Transition devcontainers to systemd as init system (#162)
* Transition devcontainers to systemd as init system
systemd 257 has excellent container support — auto-detecting container
environments via /.dockerenv, gracefully skipping host-only mounts,
falling back to unsandboxed generators when namespace sandboxing fails,
and disabling unnecessary services via ConditionVirtualization=!container.
Running systemd as PID 1 in privileged Docker containers just works now,
so let's transition the devcontainers to better match HAOS and Supervised
installations where Supervisor normally runs.
Key changes:
- Run systemd as PID 1 via /sbin/init with overrideCommand: false
- Remove the fake systemctl and policy-rc.d shipped by the Microsoft
base images, which silently blocked all service management at build
time
- Make sure all required services which are not enabled by default are
enabled (haos-agent, journal-gatewayd) via systemctl enable in the
Dockerfile so they start automatically on boot
- Mask unnecessary units (networkd, getty) to avoid interference
- Remove all manual daemon start/stop functions from the common scripts
(start_docker, stop_docker, init_dbus, init_udev, init_os_agent,
start_systemd_journald) — systemd manages the full service lifecycle
- Clean up supervisor_run scripts to only handle Supervisor-specific
logic (build, run, cleanup) since services are already running
- Remove machine-id regeneration from supervisor_bootstrap, systemd
handles this at boot
- Add /var/lib/containerd volume mount alongside /var/lib/docker, since
modern Docker uses the containerd snapshotter which stores state in
its own top-level directory rather than under /var/lib/docker
- Move systemd-journal-remote and systemd-resolved installs into the
Dockerfiles directly
- Set up persistent journal storage via systemd-tmpfiles at build time
- Use dbus-broker as D-Bus broker (used by HAOS)
* Fail if curl isn't able to fetch version information
* Bump container image version in devcontainer.json template
0 commit comments