In my Dockerfile I am trying to install multiple services and want to have them all start up automatically when I launch the container. One among the services is mysql and when I launch the container I don’t see the mysql service starting up. When I try to start manually, I get the error: Failed to get D-Bus connection: Operation not permitted
Dockerfile:
FROM centos:7
RUN yum -y install mariadb mariadb-server
CMD ["/bin/bash", “service mariadb start”]
Docker build:
docker build --tag=“pbellamk/mariadb” .
Docker run:
docker run -it -d --privileged=true pbellamk/mariadb bash
I have checked the centos:systemd image and that doesn’t help too. How do I launch the container with the services
Can someone show an example of how to start the container with 3 services(mariadb, httpd, sshd) to be running when it is launched ?
Thanks,
Premchand
started using systemctl/service commands.