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
/
ubuntu-18.04-pinned.dockerfile
84 lines (84 loc) · 5.59 KB
/
ubuntu-18.04-pinned.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
FROM ubuntu:18.04
ENV VERSION 1
# install dependencies.
RUN apt-get update && \
apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y git make \
bzip2 automake libbz2-dev libssl-dev doxygen graphviz libgmp3-dev \
autotools-dev libicu-dev python2.7 python2.7-dev python3 \
python3-dev python-configparser python-requests python-pip \
autoconf libtool g++ gcc curl zlib1g-dev sudo ruby libusb-1.0-0-dev \
libcurl4-gnutls-dev pkg-config patch 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 clang8
RUN git clone --single-branch --branch release_80 https://github.com/llvm-mirror/llvm.git clang8 && cd clang8 && git checkout 18e41dc && sed -i 's,https://github.com/llvm-mirror/,https://git.llvm.org/git/,g' .git/config && \
cd tools && git clone --single-branch --branch release_80 https://github.com/llvm-mirror/lld.git && cd lld && git checkout d60a035 && \
cd ../ && git clone --single-branch --branch release_80 https://github.com/llvm-mirror/polly.git && cd polly && git checkout 1bc06e5 && \
cd ../ && git clone --single-branch --branch release_80 https://github.com/llvm-mirror/clang.git clang && cd clang && git checkout a03da8b && sed -i 's,https://github.com/llvm-mirror/,https://git.llvm.org/git/,g' .git/config && \
cd tools && mkdir extra && cd extra && git clone --single-branch --branch release_80 https://github.com/llvm-mirror/clang-tools-extra.git && cd clang-tools-extra && git checkout 6b34834 && \
cd /clang8/projects && git clone --single-branch --branch release_80 https://github.com/llvm-mirror/libcxx.git && cd libcxx && git checkout 1853712 && \
cd ../ && git clone --single-branch --branch release_80 https://github.com/llvm-mirror/libcxxabi.git && cd libcxxabi && git checkout d7338a4 && \
cd ../ && git clone --single-branch --branch release_80 https://github.com/llvm-mirror/libunwind.git && cd libunwind && git checkout 57f6739 && \
cd ../ && git clone --single-branch --branch release_80 https://github.com/llvm-mirror/compiler-rt.git && cd compiler-rt && git checkout 5bc7979 && \
mkdir /clang8/build && cd /clang8/build && \
cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX='/usr/local' -DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_ENABLE_LIBCXX=ON -DLLVM_ENABLE_RTTI=ON -DLLVM_INCLUDE_DOCS=OFF -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Release .. && \
make -j $(nproc) && \
make install && \
cd / && \
rm -rf /clang8
COPY ./.cicd/helpers/clang.make /tmp/clang.cmake
# build llvm8
RUN git clone --depth 1 --single-branch --branch release_80 https://github.com/llvm-mirror/llvm.git llvm && \
cd llvm && \
mkdir build && \
cd build && \
cmake -G 'Unix Makefiles' -DLLVM_TARGETS_TO_BUILD=host -DLLVM_BUILD_TOOLS=false -DLLVM_ENABLE_RTTI=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_TOOLCHAIN_FILE='/tmp/clang.cmake' -DCMAKE_EXE_LINKER_FLAGS=-pthread -DCMAKE_SHARED_LINKER_FLAGS=-pthread -DLLVM_ENABLE_PIC=NO .. && \
make -j$(nproc) && \
make install && \
cd / && \
rm -rf /llvm
# 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 --with-toolset=clang --prefix=/usr/local && \
./b2 toolset=clang cxxflags='-stdlib=libc++ -D__STRICT_ANSI__ -nostdinc++ -I/usr/local/include/c++/v1 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fpie' linkflags='-stdlib=libc++ -pie' link=static threading=multi --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 http://downloads.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.1.1.tgz && \
tar -xzf mongodb-linux-x86_64-ubuntu1804-4.1.1.tgz && \
rm -f mongodb-linux-x86_64-ubuntu1804-4.1.1.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 -DCMAKE_TOOLCHAIN_FILE='/tmp/clang.cmake' .. && \
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 -DCMAKE_TOOLCHAIN_FILE='/tmp/clang.cmake' .. && \
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-ubuntu1804-4.1.1/bin