1FROM centos:7
2
3RUN yum install -y git \
4                   tar \
5                   wget \
6                   which \
7                   make \
8                   emacs \
9                   autoconf \
10                   curl-devel \
11                   unzip \
12                   automake \
13                   libtool \
14                   glibc-static.i686 \
15                   glibc-devel \
16                   glibc-devel.i686
17
18RUN yum update -y nss
19
20# Install Java 8
21RUN wget -q --no-cookies --no-check-certificate \
22    --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \
23    "http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz" \
24    -O - | tar xz -C /var/local
25ENV JAVA_HOME /var/local/jdk1.8.0_131
26ENV PATH $JAVA_HOME/bin:$PATH
27
28# Install Clang 5
29RUN yum install -y centos-release-scl
30RUN yum install -y llvm-toolset-7
31ENV CC /opt/rh/llvm-toolset-7/root/usr/bin/clang
32ENV CXX /opt/rh/llvm-toolset-7/root/usr/bin/clang++
33
34# Download and install Golang
35WORKDIR /
36ENV GOLANG_VERSION 1.10.5
37ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
38ENV GOLANG_DOWNLOAD_SHA256 a035d9beda8341b645d3f45a1b620cf2d8fb0c5eb409be36b389c0fd384ecc3a
39RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
40	&& echo "$GOLANG_DOWNLOAD_SHA256  golang.tar.gz" | sha256sum -c - \
41	&& tar -C /usr/local -xzf golang.tar.gz \
42	&& rm golang.tar.gz
43ENV GOPATH /go
44ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
45RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
46
47# Build and install CMake from source.
48WORKDIR /usr/src
49RUN git clone git://cmake.org/cmake.git CMake && \
50  cd CMake && \
51  git checkout v3.4.1 && \
52  mkdir /usr/src/CMake-build && \
53  cd /usr/src/CMake-build && \
54  /usr/src/CMake/bootstrap \
55    --parallel=$(grep -c processor /proc/cpuinfo) \
56    --prefix=/usr && \
57  make -j$(grep -c processor /proc/cpuinfo) && \
58  ./bin/cmake \
59    -DCMAKE_BUILD_TYPE:STRING=Release \
60    -DCMAKE_USE_OPENSSL:BOOL=ON . && \
61  make install && \
62  cd .. && rm -rf CMake*
63
64# Build and install Python from source.
65WORKDIR /usr/src
66ENV PYTHON_VERSION 2.7.14
67RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \
68  tar xvzf Python-${PYTHON_VERSION}.tgz && \
69  cd Python-${PYTHON_VERSION} && \
70  ./configure && \
71  make -j$(grep -c processor /proc/cpuinfo) && \
72  make install && \
73  cd .. && rm -rf Python-${PYTHON_VERSION}*
74
75# Build and install ninja from source.
76WORKDIR /usr/src
77ENV NINJA_VERSION 1.8.2
78RUN git clone https://github.com/martine/ninja.git && \
79  cd ninja && \
80  git checkout v$NINJA_VERSION && \
81  ./configure.py --bootstrap && \
82  mv ninja /usr/bin/ && \
83  cd .. && rm -rf ninja
84
85# Build and install BoringSSL from source.
86ENV BORINGSSL_HOME /usr/src/boringssl
87ENV BORINGSSL_BUILD_DIR $BORINGSSL_HOME/build64
88RUN git clone --depth 1 https://boringssl.googlesource.com/boringssl $BORINGSSL_HOME
89RUN mkdir $BORINGSSL_BUILD_DIR
90WORKDIR $BORINGSSL_BUILD_DIR
91RUN cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_ASM_FLAGS=-Wa,--noexecstack -GNinja ..
92RUN ninja
93
94# Download conscrypt.
95WORKDIR /
96RUN git clone --depth 1 --no-single-branch https://github.com/google/conscrypt.git
97
98# Start in toolset environment that uses Clang 5
99CMD ["scl", "enable", "llvm-toolset-7", "bash"]
100