How to start D-Bus in Docker container

Many Linux applications require D-Bus which is not running by default in Docker containers.

When you attempt to start the application you might get the following error:

First of all you need to generate missing machine-id by command:

The application will be able to start even when the daemon is not running.

To start the D-Bus daemon inside the container you need to run following command on Ubuntu, Centos 7, Centos 8:

Command on Centos 6:

Now the daemon is running and your application should be able to start. The output should look like this: