[Solved] docker Error: System has not been booted with systemd as init system (PID 1). Can‘t operate. Failed to con

Environment centos7 eight

The docker container reported an error using the systemctl command:

[[email protected] yum.repos.d]# systemctl status firewalld
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

Solution:

Add the parameter — privileged when starting the container

[[email protected] ~]# docker run -itd --name c8 --privileged centos /usr/sbin/init
6a6a3c9f9fa9acc59d62a6e82ccb6a637db8aada004aa8a096c6061108c6b144
[[email protected] ~]# docker exec -it c8 /bin/bash

Read More: