Home | History | Annotate | Download | only in conscrypt
      1 FROM centos:6.6
      2 
      3 # This enables compatibility with Docker overlayfs
      4 RUN yum install -y yum-plugin-ovl
      5 
      6 RUN yum install -y git \
      7                    tar \
      8                    wget \
      9                    which \
     10                    make \
     11                    emacs \
     12                    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.
     22 RUN yum install -y epel-release
     23 RUN yum install -y clang
     24 
     25 # Install Java 8
     26 RUN wget -q --no-cookies --no-check-certificate \
     27     --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \
     28     "http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz" \
     29     -O - | tar xz -C /var/local
     30 ENV JAVA_HOME /var/local/jdk1.8.0_131
     31 ENV 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.
     37 WORKDIR /etc/yum.repos.d
     38 RUN wget --no-check-certificate http://people.centos.org/tru/devtools-2/devtools-2.repo
     39 RUN yum install -y devtoolset-2-gcc \
     40                    devtoolset-2-binutils \
     41                    devtoolset-2-gcc-c++ \
     42                    || true
     43 ENV CC /opt/rh/devtoolset-2/root/usr/bin/gcc
     44 ENV CXX /opt/rh/devtoolset-2/root/usr/bin/g++
     45 
     46 # Download and install Golang
     47 WORKDIR /
     48 ENV GOLANG_VERSION 1.6.4
     49 ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
     50 ENV GOLANG_DOWNLOAD_SHA256 b58bf5cede40b21812dfa031258db18fc39746cc0972bc26dae0393acc377aaf
     51 RUN 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
     55 ENV GOPATH /go
     56 ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
     57 RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
     58 
     59 # Build and install CMake from source.
     60 WORKDIR /usr/src
     61 RUN 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.
     77 WORKDIR /usr/src
     78 ENV PYTHON_VERSION 2.7.10
     79 RUN 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.
     88 WORKDIR /usr/src
     89 ENV NINJA_VERSION 1.6.0
     90 RUN 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.
     98 ENV BORINGSSL_HOME /usr/src/boringssl
     99 ENV BORINGSSL_BUILD_DIR $BORINGSSL_HOME/build64
    100 RUN git clone --depth 1 https://boringssl.googlesource.com/boringssl $BORINGSSL_HOME
    101 RUN mkdir $BORINGSSL_BUILD_DIR
    102 WORKDIR $BORINGSSL_BUILD_DIR
    103 RUN cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_ASM_FLAGS=-Wa,--noexecstack -GNinja ..
    104 RUN ninja
    105 
    106 # Download conscrypt.
    107 WORKDIR /
    108 RUN git clone --depth 1 https://github.com/google/conscrypt.git
    109 
    110 # Start in devtoolset environment that uses GCC 4.8
    111 CMD ["scl", "enable", "devtoolset-2", "bash"]
    112