Connect to mongodb on centos7 docker image
<p>i am new with docker (1 day) and i want to make an image with the full env for new people.</p>

<p>So i just installed mongodb on my image:</p>

<pre><code>RUN echo $'[mongodb-org-3.2] \n\
name       = MongoDB Repository \n\
baseurl    = https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/ \n\
gpgcheck   = 1 \n\
enabled    = 1 \n\
gpgkey     = https://www.mongodb.org/static/pgp/server-3.2.asc' &gt; /etc/yum.repos.d/mongodb-org.repo
RUN yum install -y mongodb-org
</code></pre>

<p>But when i run it with <code>sudo docker run -t -i myimage  /bin/bash</code> and try to start mongo with <code>systemctl start mongod</code> i got this error:</p>

<p>Failed to get D-Bus connection: Operation not permitted</p>