Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fedora systemd docker won't start. (LoL I spoke to soon) ... #16

Open
nmvega opened this issue Apr 9, 2021 · 2 comments
Open

Fedora systemd docker won't start. (LoL I spoke to soon) ... #16

nmvega opened this issue Apr 9, 2021 · 2 comments

Comments

@nmvega
Copy link

nmvega commented Apr 9, 2021

Hi Friend:

I've successfully used your Dockerfile before, and it works well. I was tinkering with it today, and for some reason it doesn't launch.

I pasted my session below:

user@fedora-33$ cat Dockerfile
======================================
FROM fedora:latest

ENV container docker

RUN dnf -y update \
    && dnf -y install systemd \
    && dnf clean all

RUN cd /lib/systemd/system/sysinit.target.wants/; \
    for i in *; do [ $i = systemd-tmpfiles-setup.service ] || rm -f $i; done

RUN rm -f /lib/systemd/system/multi-user.target.wants/* \
    /etc/systemd/system/*.wants/* \
    /lib/systemd/system/local-fs.target.wants/* \
    /lib/systemd/system/sockets.target.wants/*udev* \
    /lib/systemd/system/sockets.target.wants/*initctl* \
    /lib/systemd/system/basic.target.wants/* \
    /lib/systemd/system/anaconda.target.wants/*

VOLUME [ "/sys/fs/cgroup" ]

CMD ["/usr/sbin/init"]
======================================

user@fedora-33$ docker run -d --name systemd-fedora --tmpfs /tmp \
                   --tmpfs /run --tmpfs /run/lock \
                   -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
                   jrei/systemd-fedora

user@fedora-33$ docker images
REPOSITORY            TAG       IMAGE ID       CREATED       SIZE
jrei/systemd-fedora   latest    30627080674c   6 weeks ago   224MB

user@fedora-33$ docker run -d --name systemd-fedora --tmpfs /tmp \
                   --tmpfs /run --tmpfs /run/lock \
                   -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
                   jrei/systemd-fedora

user@fedora-33$ docker ps -a
CONTAINER ID   IMAGE                 COMMAND            CREATED          STATUS                       PORTS     NAMES
e6715541e20f   jrei/systemd-fedora   "/usr/sbin/init"   10 seconds ago   Exited (255) 9 seconds ago             systemd-fedora

Just FYI (not urgent). 😊

@j8r
Copy link
Owner

j8r commented Apr 10, 2021

I just tried, no issues on my side:

CONTAINER ID  IMAGE                                 COMMAND         CREATED         STATUS             PORTS   NAMES
b12c49193c2d  docker.io/jrei/systemd-fedora:latest  /usr/sbin/init  36 seconds ago  Up 36 seconds ago          systemd-fedora

As said in the README.md instructions, try also docker run -d --name systemd-fedora --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro jrei/systemd-fedora.

Being in Fedora, look also at SELinux.

I can't reproduce, so you'll have to figure out the actual error.

@nmvega
Copy link
Author

nmvega commented Apr 10, 2021

@j8r Yeah, I had already tried both command variations. Also, disabling SELinux is the first thing I do on all my Fedora O/Ss. 😄 I'll play with it more to see. It's odd, because I used this base specification a million times. I'll let you know. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants