Systemctl command in docker container

In the traditional CentOS container, if you want to use systemctl, you will encounter the following situations

The system prompts you that you cannot use systemctl because the current system is not booted by systemd
Therefore, it is not difficult to understand why the following commands can use systemctl

docker run -itd --name=centos --privileged=true centos /usr/sbin/init

But relatively speaking, the situation of Ubuntu will be more trouble

docker run -i -t -d --name ubuntu --privileged -v /run/systemd/system:/run/systemd/system -v /bin/systemctl:/bin/systemctl -v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket -it ubuntu systemctl
Send a Message