There is one detail that I missed in my question above, which I once ran systemd in the container itself, systemctl reboot (roughly speaking), connecting to systemd in the container itself, which is not what I want.
At the prompt of a colleague, here's what I did on the Fedora stock image (nothing special about it):
$ docker run -ti -v /run/systemd:/run/systemd fedora /bin/bash
Then in the container:
bash-4.2# systemctl status docker docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled) Active: active (running) since Tue 2014-07-01 04:57:22 UTC; 2 weeks 0 days ago Docs: http:
Here the container has access to systemd on the host. Then issuing the reboot command actually reboots the host:
bash-4.2
Thus, you can restart the host from the container.
It should be noted that the host runs Fedora 20, as well as in the container. If the host was another distribution not run by systemd , this would not be possible. Generally speaking, if the host and container start distributions that do not start systemd or incompatible versions of systemd, this will not work.
user59634
source share