1 FROM centos:7 2 3 RUN 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 18 RUN yum update -y nss 19 20 # Install Java 8 21 RUN 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 25 ENV JAVA_HOME /var/local/jdk1.8.0_131 26 ENV PATH $JAVA_HOME/bin:$PATH 27 28 # Install Clang 5 29 RUN yum install -y centos-release-scl 30 RUN yum install -y llvm-toolset-7 31 ENV CC /opt/rh/llvm-toolset-7/root/usr/bin/clang 32 ENV CXX /opt/rh/llvm-toolset-7/root/usr/bin/clang++ 33 34 # Download and install Golang 35 WORKDIR / 36 ENV GOLANG_VERSION 1.10.5 37 ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz 38 ENV GOLANG_DOWNLOAD_SHA256 a035d9beda8341b645d3f45a1b620cf2d8fb0c5eb409be36b389c0fd384ecc3a 39 RUN 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 43 ENV GOPATH /go 44 ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH 45 RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" 46 47 # Build and install CMake from source. 48 WORKDIR /usr/src 49 RUN 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. 65 WORKDIR /usr/src 66 ENV PYTHON_VERSION 2.7.14 67 RUN 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. 76 WORKDIR /usr/src 77 ENV NINJA_VERSION 1.8.2 78 RUN 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. 86 ENV BORINGSSL_HOME /usr/src/boringssl 87 ENV BORINGSSL_BUILD_DIR $BORINGSSL_HOME/build64 88 RUN git clone --depth 1 https://boringssl.googlesource.com/boringssl $BORINGSSL_HOME 89 RUN mkdir $BORINGSSL_BUILD_DIR 90 WORKDIR $BORINGSSL_BUILD_DIR 91 RUN cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_ASM_FLAGS=-Wa,--noexecstack -GNinja .. 92 RUN ninja 93 94 # Download conscrypt. 95 WORKDIR / 96 RUN git clone --depth 1 --no-single-branch https://github.com/google/conscrypt.git 97 98 # Start in toolset environment that uses Clang 5 99 CMD ["scl", "enable", "llvm-toolset-7", "bash"] 100