Home | History | Annotate | Download | only in docker
      1 # This Dockerfile specifies the recipe for creating an image for the tests
      2 # to run in.
      3 #
      4 # We install as many test dependencies here as we can, because these setup
      5 # steps can be cached.  They do *not* run every time we run the build.
      6 # The Docker image is only rebuilt when the Dockerfile (ie. this file)
      7 # changes.
      8 
      9 # Base Dockerfile for gRPC dev images
     10 FROM debian:latest
     11 
     12 # Apt source for old Python versions.
     13 RUN echo 'deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu trusty main' > /etc/apt/sources.list.d/deadsnakes.list && \
     14   apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DB82666C
     15 
     16 # Apt source for Oracle Java.
     17 run echo 'deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main' > /etc/apt/sources.list.d/webupd8team-java-trusty.list && \
     18   apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 && \
     19   echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections
     20 
     21 # Apt source for Mono
     22 run echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list && \
     23   echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list && \
     24   apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
     25 
     26 # Install dotnet SDK based on https://www.microsoft.com/net/core#debian
     27 # (Ubuntu instructions need apt to support https)
     28 RUN apt-get update && apt-get install -y curl libunwind8 gettext && \
     29   curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID=809130 && \
     30   mkdir -p /opt/dotnet && tar zxf dotnet.tar.gz -C /opt/dotnet && \
     31   ln -s /opt/dotnet/dotnet /usr/local/bin
     32 
     33 # Install dependencies.  We start with the basic ones require to build protoc
     34 # and the C++ build
     35 RUN apt-get update && apt-get install -y \
     36   autoconf \
     37   autotools-dev \
     38   build-essential \
     39   bzip2 \
     40   ccache \
     41   curl \
     42   gcc \
     43   git \
     44   libc6 \
     45   libc6-dbg \
     46   libc6-dev \
     47   libgtest-dev \
     48   libtool \
     49   make \
     50   parallel \
     51   time \
     52   wget \
     53   # -- For csharp --
     54   mono-devel \
     55   referenceassemblies-pcl \
     56   nunit \
     57   # -- For all Java builds -- \
     58   maven \
     59   # -- For java_jdk6 -- \
     60   #   oops! not in jessie. too old? openjdk-6-jdk \
     61   # -- For java_jdk7 -- \
     62   openjdk-7-jdk \
     63   # -- For java_oracle7 -- \
     64   oracle-java7-installer \
     65   # -- For python / python_cpp -- \
     66   python-setuptools \
     67   python-pip \
     68   python-dev \
     69   python2.6-dev \
     70   python3.3-dev \
     71   python3.4-dev \
     72   # -- For Ruby --
     73   ruby \
     74   && apt-get clean
     75 
     76 ##################
     77 # C# dependencies
     78 
     79 RUN wget www.nuget.org/NuGet.exe -O /usr/local/bin/nuget.exe
     80 
     81 ##################
     82 # Python dependencies
     83 
     84 # These packages exist in apt-get, but their versions are too old, so we have
     85 # to get updates from pip.
     86 
     87 RUN pip install pip --upgrade
     88 RUN pip install virtualenv tox yattag
     89 
     90 ##################
     91 # Ruby dependencies
     92 
     93 # Install rvm
     94 RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
     95 RUN \curl -sSL https://get.rvm.io | bash -s stable
     96 
     97 # Install Ruby 2.1, Ruby 2.2 and JRuby 1.7
     98 RUN /bin/bash -l -c "rvm install ruby-2.1"
     99 RUN /bin/bash -l -c "rvm install ruby-2.2"
    100 RUN /bin/bash -l -c "rvm install jruby-1.7"
    101 RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
    102 RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
    103 RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc"
    104 
    105 ##################
    106 # Java dependencies
    107 
    108 # This step requires compiling protoc. :(
    109 
    110 ENV MAVEN_REPO /var/maven_local_repository
    111 ENV MVN mvn --batch-mode
    112 
    113 RUN cd /tmp && \
    114   git clone https://github.com/google/protobuf.git && \
    115   cd protobuf && \
    116   ./autogen.sh && \
    117   ./configure && \
    118   make -j6 && \
    119   cd java && \
    120   $MVN install dependency:go-offline -Dmaven.repo.local=$MAVEN_REPO && \
    121   cd ../javanano && \
    122   $MVN install dependency:go-offline -Dmaven.repo.local=$MAVEN_REPO
    123 
    124 ##################
    125 # Go dependencies.
    126 RUN apt-get install -y  \
    127   # -- For go -- \
    128   golang
    129 
    130 ##################
    131 # Javascript dependencies.
    132 Run apt-get install -y \
    133   # -- For javascript -- \
    134   npm
    135 
    136 # On Debian/Ubuntu, nodejs binary is named 'nodejs' because the name 'node'
    137 # is taken by another legacy binary. We don't have that legacy binary and
    138 # npm expects the binary to be named 'node', so we just create a symbol
    139 # link here.
    140 RUN ln -s `which nodejs` /usr/bin/node
    141 
    142 ##################
    143 # Prepare ccache
    144 
    145 RUN ln -s /usr/bin/ccache /usr/local/bin/gcc
    146 RUN ln -s /usr/bin/ccache /usr/local/bin/g++
    147 RUN ln -s /usr/bin/ccache /usr/local/bin/cc
    148 RUN ln -s /usr/bin/ccache /usr/local/bin/c++
    149 RUN ln -s /usr/bin/ccache /usr/local/bin/clang
    150 RUN ln -s /usr/bin/ccache /usr/local/bin/clang++
    151 
    152 # Define the default command.
    153 CMD ["bash"]
    154