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
/
amazon_linux-2-unpinned.dockerfile
54 lines (54 loc) · 2.65 KB
/
amazon_linux-2-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
FROM amazonlinux:2.0.20190508
ENV VERSION 1
# install dependencies.
RUN yum update -y && \
yum install -y which git sudo procps-ng util-linux autoconf automake \
libtool make bzip2 bzip2-devel openssl-devel gmp-devel libstdc++ libcurl-devel \
libusbx-devel python3 python3-devel python-devel libedit-devel doxygen \
graphviz clang patch llvm-devel llvm-static vim-common jq
# build cmake.
RUN curl -LO https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz && \
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 && \
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 && \
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 && \
tar -xzf mongo-cxx-driver-r3.4.0.tar.gz && \
cd mongo-cxx-driver-r3.4.0 && \
sed -i 's/\"maxAwaitTimeMS\", count/\"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