【Docker】How to solve 'Failed to get D-Bus connection: Operation not permitted'

I tried to build centos7 container and type 'systemctl ***' command, I got titled error. As many other sites mentioned, adding '--privileged' option when docker run didn't work to me. What worked was adding '/sbin/init' at the end of command when docker run as below.

(例) docker run -d --privileged -p 8000:80 -it --name {container name} centos/httpd /sbin/init

If you use centos, utilizing the image 'centos/systemd' will also allow you to use 'systemctl' command.

docker pull centos/systemd
docker run -d --privileged -p 8000:80 -it --name {container name} centos/systemd
docker exec -it {container name} bash