title: Installing Mongo c and c++ drivers in Docker
body: <p>I'm attempting to install the mongocxx driver in a Docker container, and step number one is to install the mongo-c driver using package manager. My slimmed down Dockerfile:</p>
  
  <pre><code>FROM phusion/baseimage:latest
  RUN apt-get install -y libmongoc-1.0-0
  </code></pre>
  
  <p>After this step I should be ready to install the cxx driver by following the instructions here: <a href="https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/installation/" rel="nofollow noreferrer">https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/installation/</a></p>
  
  <pre><code>RUN git clone https://github.com/mongodb/mongo-cxx-driver.git  --branch releases/stable --depth 1
  WORKDIR /mongo-cxx-driver/build
  RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
  RUN make EP_mnmlstc_core
  RUN make &amp;&amp; make install
  </code></pre>
  
  <p>This proceeds until the cmake step fails, unable to find the libbson package</p>
  
  <pre><code>Step 17/25 : RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
   ---&gt; Running in ba6033b680bb
  -- The CXX compiler identification is GNU 5.4.0
  -- Check for working CXX compiler: /usr/bin/c++
  -- Check for working CXX compiler: /usr/bin/c++ -- works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- The C compiler identification is GNU 5.4.0
  -- Check for working C compiler: /usr/bin/cc
  -- Check for working C compiler: /usr/bin/cc -- works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Checking for module 'libbson-1.0&gt;=1.5.0'
  --   
  CMake Error at /usr/share/cmake-3.5/Modules/FindPkgConfig.cmake:367 (message):
    A required package was not found
  </code></pre>
  
  <p>If I try searching for the libmongoc-1.0 and libbson-1.0 packages using pkg-config it's almost as if nothing was installed from the mongo-c driver.</p>
  
  <pre><code>Step 17/26 : RUN pkg-config --cflags --libs libmongoc-1.0 libbson-1.0
   ---&gt; Running in 343f3b4feb3b
  Package libmongoc-1.0 was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libmongoc-1.0.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libmongoc-1.0' found
  Package libbson-1.0 was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libbson-1.0.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libbson-1.0' found
  </code></pre>
  
  <p>Has anyone had the experience of installing in a Docker instance? Any insight to what is going wrong here?</p>