Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
Dockerfile
Dockerfile.vapor
README.md

README.md

Building libmongoc From Source With Docker

For the mongo-swift-driver to run, the minimum required version of the C Driver is 1.13.0. The easiest way to get the correct version of libmongoc and libbson is to checkout the correct branch from git and build the sources.

Dependencies

  • Ubuntu 16.04 / 18.04
  • git
  • cmake
  • libssl-dev
  • libsasl2-dev

Build

RUN git clone -b r1.13 https://github.com/mongodb/mongo-c-driver /tmp/libmongoc
WORKDIR /tmp/libmongoc
RUN cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr
RUN make -j8 install

Further useful cmake prefixes are:

  • -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF see reference here.
  • -DCMAKE_BUILD_TYPE=Release to build a release optimized build.

Vapor

When building and running Vapor in Docker, the C Driver is needed in both the builder and runner containers. See Dockerfile.vapor for an example.

You can’t perform that action at this time.