Le 27/09/2022 à 20:30, Daniel Walsh a écrit :
On 9/27/22 04:39, Yvan Masson wrote:
Le 26/09/2022 à 21:45, Daniel Walsh a écrit :
On 9/25/22 03:24, Yvan Masson wrote:
Hi list,
I am quite new to Podman/Docker and containers in general. For some reasons, I want to run systemd in a unprivileged container, but it does not really works: - If I run my container with `podman run localhost/my_image:latest` it fails with error "Trying to run as user instance, but the system has not been booted with systemd.". Using option `systemd=always` does not help. - However, if I run my container with `podman run localhost/my_image:latest /lib/systemd/systemd` then it works.
My Containerfile: FROM docker.io/library/debian:bullseye RUN apt-get update RUN apt-get install systemd --assume-yes --no-install-recommends CMD /lib/systemd/systemd
Do you know what should I do so that my `CMD /lib/systemd/systemd` directive works?
Regards, Yvan
_______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
Please open an issue on github.com/containers/podman/issues
And include the output of podman info
Does
podman run ubi8-init
Work? _______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io Hi Daniel,
Thanks for the answer. I reported this issue upstream: https://github.com/containers/podman/issues/15954
I ran `podman run registry.access.redhat.com/ubi8-init` and it works perfectly, so maybe this is an issue with Debian image instead?
Regards, Yvan
_______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
Could you try with ENTRYPOINT /lib/systemd/systemd _______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
Thanks for your answers Chris and Daniel, and sorry for the late reply. After discussion on Github (https://github.com/containers/podman/discussions/15965), the solution here is to use `["/lib/systemd/systemd"]` instead of `/lib/systemd/systemd` to avoid running `/bin/sh` (see discussion above and https://docs.docker.com/engine/reference/builder/#cmd). Regards, Yvan