Hi,
I am trying to install a spirit agent on RHEL docker container. I am using Dockerfile to build my own image.It is able to install the spirit agent but while starting the service using service command its saying
Failed to get D-Bus connection: Operation not permitted
Restarting spiritAgent (via systemctl): Failed to get D-Bus connection: Operation not permitted
I searched in google about this. I found that systemd is not present or installed.I tried to install systemd using following Dockerfile.This solution is given in following link.
https://rhatdan.wordpress.com/2014/04/30/running-systemd-within-a-docker-container/
#Dockerfile
FROM rhel7:latest
MAINTAINER
ENV container docker
RUN yum -y install systemd; yum clean all;
(cd /lib/systemd/system/sysinit.target.wants/; for i in ; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done);
rm -f /lib/systemd/system/multi-user.target.wants/;
rm -f /etc/systemd/system/.wants/;
rm -f /lib/systemd/system/local-fs.target.wants/;
rm -f /lib/systemd/system/sockets.target.wants/udev;
rm -f /lib/systemd/system/sockets.target.wants/initctl;
rm -f /lib/systemd/system/basic.target.wants/;
rm -f /lib/systemd/system/anaconda.target.wants/*;
VOLUME [ \u201c/sys/fs/cgroup\u201d ]
CMD [\u201c/usr/sbin/init\u201d]
After creating the image using above Dockerfile, I used that image to install spirit agent. Still i am getting
a same error while starting the service. I tried many solutions suggested in google, but didn’t work.
I am using a RHEL 7.2 (Maipo) docker container image.
Can anyone look into this and help me out…
_Thank you