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