Alpine based container with mongo C/C++ drivers installed
10K+
Alpine based container with Mongo C/C++ libraries installed as static libraries. Libraries installed under /opt/local.
Note: The gcc tag is built off the latest gcc base image.
FROM sptrakesh/cppbase
RUN apk add --no-cache curl perl snappy-dev
ENV MONGOC_VERSION=1.14.0 \
MONGOCXX_VERSION=3.4.0
WORKDIR /opt
RUN curl -L -O https://github.com/mongodb/mongo-c-driver/releases/download/${MONGOC_VERSION}/mongo-c-driver-${MONGOC_VERSION}.tar.gz \
&& tar xzf mongo-c-driver-${MONGOC_VERSION}.tar.gz \
&& cd mongo-c-driver-${MONGOC_VERSION} \
&& mkdir cmake-build && cd cmake-build \
&& cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/local -DBUILD_SHARED_LIBS=OFF -DENABLE_TESTS=OFF .. \
&& make -j8 \
&& make install
WORKDIR /opt
RUN git clone https://github.com/mongodb/mongo-cxx-driver.git --branch releases/stable --depth 1 \
&& cd mongo-cxx-driver/build \
&& cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/opt/local -DCMAKE_INSTALL_PREFIX=/opt/local -DBUILD_SHARED_LIBS=OFF -DCMAKE_TESTING_ENABLED=OFF .. \
&& make -j8 \
&& make install \
&& for i in `ls /opt/local/lib64/pkgconfig`; do sed -i -e 's;libdir=${prefix}/lib;libdir=${prefix}/lib64;g' /opt/local/lib64/pkgconfig/$i; done \
&& apk --update --no-cache del perl
FROM sptrakesh/cppbase
MAINTAINER Rakesh Vidyadharan <[email protected]>
ENV MONGOC_VERSION=1.4.0 \
MONGOCXX_VERSION=3.4.0
RUN apk --update --no-cache add snappy-dev \
&& apk --update --no-cache del perl
WORKDIR /opt
COPY --from=0 /opt/local local
Content type
Image
Digest
sha256:6bc8f3843…
Size
216.4 MB
Last updated
17 days ago
docker pull sptrakesh/mongocxx