• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1FROM centos:6.6
2
3RUN yum install -y git \
4                   tar \
5                   wget \
6                   which \
7                   make \
8                   autoconf \
9                   curl-devel \
10                   unzip \
11                   automake \
12                   libtool \
13                   glibc-static.i686 \
14                   glibc-devel \
15                   glibc-devel.i686
16
17# Install clang.
18RUN yum install -y epel-release
19RUN yum install -y clang
20
21# Install Java 8
22RUN wget -q --no-cookies --no-check-certificate \
23    --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \
24    "http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz" \
25    -O - | tar xz -C /var/local
26ENV JAVA_HOME /var/local/jdk1.8.0_131
27ENV PATH $JAVA_HOME/bin:$PATH
28
29# Install GCC 4.8
30# We'll get and "Rpmdb checksum is invalid: dCDPT(pkg checksums)" error caused by
31# docker issue when using overlay storage driver, but all the stuff we need
32# will be installed, so for now we just ignore the error.
33WORKDIR /etc/yum.repos.d
34RUN wget --no-check-certificate http://people.centos.org/tru/devtools-2/devtools-2.repo
35RUN yum install -y devtoolset-2-gcc \
36                   devtoolset-2-binutils \
37                   devtoolset-2-gcc-c++ \
38                   || true
39ENV CC /opt/rh/devtoolset-2/root/usr/bin/gcc
40ENV CXX /opt/rh/devtoolset-2/root/usr/bin/g++
41
42# Download and install Golang
43WORKDIR /
44ENV GOLANG_VERSION 1.6.4
45ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
46ENV GOLANG_DOWNLOAD_SHA256 b58bf5cede40b21812dfa031258db18fc39746cc0972bc26dae0393acc377aaf
47RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
48	&& echo "$GOLANG_DOWNLOAD_SHA256  golang.tar.gz" | sha256sum -c - \
49	&& tar -C /usr/local -xzf golang.tar.gz \
50	&& rm golang.tar.gz
51ENV GOPATH /go
52ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
53RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
54
55# Build and install CMake from source.
56WORKDIR /usr/src
57RUN git clone git://cmake.org/cmake.git CMake && \
58  cd CMake && \
59  git checkout v3.4.1 && \
60  mkdir /usr/src/CMake-build && \
61  cd /usr/src/CMake-build && \
62  /usr/src/CMake/bootstrap \
63    --parallel=$(grep -c processor /proc/cpuinfo) \
64    --prefix=/usr && \
65  make -j$(grep -c processor /proc/cpuinfo) && \
66  ./bin/cmake \
67    -DCMAKE_BUILD_TYPE:STRING=Release \
68    -DCMAKE_USE_OPENSSL:BOOL=ON . && \
69  make install && \
70  cd .. && rm -rf CMake*
71
72# Build and install Python from source.
73WORKDIR /usr/src
74ENV PYTHON_VERSION 2.7.10
75RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \
76  tar xvzf Python-${PYTHON_VERSION}.tgz && \
77  cd Python-${PYTHON_VERSION} && \
78  ./configure && \
79  make -j$(grep -c processor /proc/cpuinfo) && \
80  make install && \
81  cd .. && rm -rf Python-${PYTHON_VERSION}*
82
83# Build and install ninja from source.
84WORKDIR /usr/src
85ENV NINJA_VERSION 1.6.0
86RUN git clone https://github.com/martine/ninja.git && \
87  cd ninja && \
88  git checkout v$NINJA_VERSION && \
89  ./configure.py --bootstrap && \
90  mv ninja /usr/bin/ && \
91  cd .. && rm -rf ninja
92
93# Build and install BoringSSL from source.
94ENV BORINGSSL_HOME /usr/src/boringssl
95ENV BORINGSSL_BUILD_DIR $BORINGSSL_HOME/build64
96RUN git clone --depth 1 https://boringssl.googlesource.com/boringssl $BORINGSSL_HOME
97RUN mkdir $BORINGSSL_BUILD_DIR
98WORKDIR $BORINGSSL_BUILD_DIR
99RUN cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_ASM_FLAGS=-Wa,--noexecstack -GNinja ..
100RUN ninja
101
102# Download conscrypt.
103WORKDIR /
104RUN git clone --depth 1 https://github.com/google/conscrypt.git
105
106# Start in devtoolset environment that uses GCC 4.8
107CMD ["scl", "enable", "devtoolset-2", "bash"]
108