Failed to get D-Bus connection – httpd service in Docker container

I am creating a Dockerfile for PostgreSQL with CentOS7 as the base image. I am trying to start httpd service with the following command in the container,

service httpd start

and i get the following error:

  • Not able to see STDERR Output with docker
  • docker host rebooted automatically when running docker build/run
  • Unsupported config option for services service: 'httpd'
  • How do I integrate my git PHP repo into an official Docker Hub container?
  • “docker run” fails with “-v” options on CentOS6.5
  • boot2docker windows 10, unable to access container via browser
  • Redirecting to /bin/systemctl start  httpd.service
    Failed to get D-Bus connection: No connection to service manager.

    The log file directory /var/log/httpd is also empty. I guess this is the problem with Docker CentOS7 image. Any help appreciated.

  • Dockerfile fails when calling rbenv
  • docker website opens after a while - ec2/virtualbox
  • Docker not responding to CTRL+C in terminal
  • No Install group file - CentOS 7 - group install
  • Docker daemon restart and reattaching to containers
  • Error Docker deployment in Amazon EC2 - Docker container quit unexpectedly
  • One Solution collect form web for “Failed to get D-Bus connection – httpd service in Docker container”

    I have run into this a well.
    It might not be the best way, but you can find a copy of the /etc/init.d/httpd file from another computer. copy that into the container in /etc/init.d
    then run
    chkconfig --level 345 httpd on

    then you will be able to use either
    /etc/init.d/httpd start or service httpd start

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.