So this works, at least in podman
, to run unaltered debian with systemd started:
ARG IMAGE_BASE='debian'ARG IMAGE_TAG='stable-slim'FROM ${IMAGE_BASE}:${IMAGE_TAG}RUN apt-get -qq update && \ apt-get -qq install -y ca-certificates systemd systemd-sysv && \ rm -rf /var/lib/apt/lists/* && \ find /etc/systemd/system \ /lib/systemd/system \ -path '*.wants/*' \ -not -name '*journald*' \ -not -name '*systemd-tmpfiles*' \ -not -name '*systemd-user-sessions*' \ -delete -print && \ systemctl set-default multi-userSTOPSIGNAL SIGRTMIN+3ENTRYPOINT ["/sbin/init"]
But how do I add something during this process that uses systemd
? - Like say:
apt-get install -y nginx && systemctl reload nginx
I tried explicitly running /sbin/init
and storing its pid for kill
ing, or even an explicit run of /usr/lib/systemd/systemd --system --unit=basic.target
which left me with a "can only run on PID 1" error.
My goal is using Dockerfile
s to test installers without any alterations. Switching to OpenRC is a non-option.