1

The official Gentoo Dockerfile contains this line:

RUN sed -e 's/#rc_sys=""/rc_sys="docker"/g' -i /etc/rc.conf

As of the present time, Gentoo's default init is OpenRC.

If I run the docker image with CMD /sbin/init, issuing OpenRC-type commands gives the response

You are attempting to run an openrc service on a system which openrc did not boot.

...and, indeed, strings /sbin/init | grep -q "sysvinit" gives SYSVINIT

However, also from the above link, OpenRC is based on sysvinit, so that could be correct.

If I run the docker image with CMD /sbin/openrc, the image will not start, claiming dependency errors.

If I want to run multiple processes under OpenRC, should I change /etc/rc.conf back to "" (Nothing special)?

Is there something special about the "docker" RC system? Does it, perhaps, presume no init system and instead expect only one running process?

What does a "docker" RC in /etc/rc.conf mean in terms of what init system is used?

2

If you look at many of the boot runlevel init scripts, such as /etc/init.d/hostname, you will see a block as follows:

depend() {
    keyword -docker -lxc -prefix -systemd-nspawn
}

This states that the init script should NOT be used automatically on any of those system types (you can see the manpage openrc-run(8) for the full explanation of keyword).

The scripts may still be started manually, but will not be considered during automatic init dependency building. I don't recall offhand the behavior if the script is explicitly added to a runlevel.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.