This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
centos-7.7-unpinned.dockerfile
65 lines (65 loc) · 3.17 KB
/
centos-7.7-unpinned.dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM centos:7.7.1908
ENV VERSION 1
# install dependencies.
RUN yum update -y && \
yum install -y epel-release && \
yum --enablerepo=extras install -y centos-release-scl && \
yum --enablerepo=extras install -y devtoolset-8 && \
yum --enablerepo=extras install -y which git autoconf automake libtool make bzip2 doxygen \
graphviz bzip2-devel openssl-devel gmp-devel ocaml libicu-devel \
python python-devel rh-python36 gettext-devel file libusbx-devel \
libcurl-devel patch vim-common jq llvm-toolset-7.0-llvm-devel llvm-toolset-7.0-llvm-static
# build cmake.
RUN curl -LO https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz && \
source /opt/rh/devtoolset-8/enable && \
source /opt/rh/rh-python36/enable && \
tar -xzf cmake-3.13.2.tar.gz && \
cd cmake-3.13.2 && \
./bootstrap --prefix=/usr/local && \
make -j$(nproc) && \
make install && \
cd / && \
rm -rf cmake-3.13.2.tar.gz /cmake-3.13.2
# build boost
RUN curl -LO https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source/boost_1_71_0.tar.bz2 && \
source /opt/rh/devtoolset-8/enable && \
source /opt/rh/rh-python36/enable && \
tar -xjf boost_1_71_0.tar.bz2 && \
cd boost_1_71_0 && \
./bootstrap.sh --prefix=/usr/local && \
./b2 --with-iostreams --with-date_time --with-filesystem --with-system --with-program_options --with-chrono --with-test -q -j$(nproc) install && \
cd / && \
rm -rf boost_1_71_0.tar.bz2 /boost_1_71_0
# build mongodb
RUN curl -LO https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-amazon-3.6.3.tgz && \
tar -xzf mongodb-linux-x86_64-amazon-3.6.3.tgz && \
rm -f mongodb-linux-x86_64-amazon-3.6.3.tgz
# build mongodb c driver
RUN curl -LO https://github.com/mongodb/mongo-c-driver/releases/download/1.13.0/mongo-c-driver-1.13.0.tar.gz && \
source /opt/rh/devtoolset-8/enable && \
source /opt/rh/rh-python36/enable && \
tar -xzf mongo-c-driver-1.13.0.tar.gz && \
cd mongo-c-driver-1.13.0 && \
mkdir -p build && \
cd build && \
cmake --DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_BSON=ON -DENABLE_SSL=OPENSSL -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_STATIC=ON -DENABLE_ICU=OFF -DENABLE_SNAPPY=OFF .. && \
make -j$(nproc) && \
make install && \
cd / && \
rm -rf mongo-c-driver-1.13.0.tar.gz /mongo-c-driver-1.13.0
# build mongodb cxx driver
RUN curl -L https://github.com/mongodb/mongo-cxx-driver/archive/r3.4.0.tar.gz -o mongo-cxx-driver-r3.4.0.tar.gz && \
source /opt/rh/devtoolset-8/enable && \
source /opt/rh/rh-python36/enable && \
tar -xzf mongo-cxx-driver-r3.4.0.tar.gz && \
cd mongo-cxx-driver-r3.4.0 && \
sed -i 's/\"maxAwaitTimeMS\", ount/\"maxAwaitTimeMS\", static_cast<int64_t>(count)/' src/mongocxx/options/change_stream.cpp && \
sed -i 's/add_subdirectory(test)//' src/mongocxx/CMakeLists.txt src/bsoncxx/CMakeLists.txt && \
cd build && \
cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. && \
make -j$(nproc) && \
make install && \
cd / && \
rm -rf mongo-cxx-driver-r3.4.0.tar.gz /mongo-cxx-driver-r3.4.0
# add mongodb to path
ENV PATH=${PATH}:/mongodb-linux-x86_64-amazon-3.6.3/bin