Docker Community Forums

Share and learn in the Docker community.

Failed to get D-Bus connection: Operation not permitted in systemd enabled centos

I planned to install Openldap in centos. So i followed the official image of systemd centos from dockerhub.
I used the following Dockerfile to create the image.

FROM centos/systemd

RUN yum -y install openldap openldap-servers; yum clean all; systemctl start slapd; systemctl enable slapd; systemctl systemctl status slapd

RUN yum -y install net-tools

EXPOSE 389

CMD ["/usr/sbin/init"]

But when i build it, i encountered Failed to get D-Bus connection: Operation not permitted. How to fix this?