I trying to build a CentOS image with systemctl command. But each time when I build it. I obtain this error :
Step 5/7 : RUN systemctl enable syslog-ng ; systemctl start syslog-ng
---> Running in 8f5a357895e7
Failed to get D-Bus connection: Operation not permitted
The command '/bin/sh -c systemctl enable syslog-ng ; systemctl start syslog-ng' returned a non-zero code: 1
My Dockerfile :
FROM centos_systemctl:latest
RUN yum -y update
RUN yum -y install epel-release ; \
yum -y install vim ; \
yum -y install wget ; \
yum -y install rsync ; \
yum -y groupinstall "Development tools"
# Install syslog-ng 3.14
RUN cd /etc/yum.repos.d/ ; \
wget https://copr.fedorainfracloud.org/coprs/czanik/syslog-ng314/repo/epel-7/czanik-syslog-ng314-epel-7.repo ; \
yum -y install syslog-ng
RUN systemctl enable syslog-ng ; systemctl start syslog-ng
RUN yum -y remove rsyslog
# COPY config syslog-ng
CMD ["/usr/sbin/init"]
centos_systemctl:latest
according to this : https://github.com/docker-library/docs/tree/master/centos#systemd-integration
Someone know what I do wrong ?
Thanks,