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 dependencies. We start with the basic ones require to build protoc 27 # and the C++ build 28 RUN apt-get update && apt-get install -y \ 29 autoconf \ 30 autotools-dev \ 31 build-essential \ 32 bzip2 \ 33 ccache \ 34 curl \ 35 gcc \ 36 git \ 37 libc6 \ 38 libc6-dbg \ 39 libc6-dev \ 40 libgtest-dev \ 41 libtool \ 42 make \ 43 parallel \ 44 time \ 45 wget \ 46 # -- For csharp -- 47 mono-devel \ 48 referenceassemblies-pcl \ 49 nunit \ 50 # -- For all Java builds -- \ 51 maven \ 52 # -- For java_jdk6 -- \ 53 # oops! not in jessie. too old? openjdk-6-jdk \ 54 # -- For java_jdk7 -- \ 55 openjdk-7-jdk \ 56 # -- For java_oracle7 -- \ 57 oracle-java7-installer \ 58 # -- For python / python_cpp -- \ 59 python-setuptools \ 60 python-pip \ 61 python-dev \ 62 python2.6-dev \ 63 python3.3-dev \ 64 python3.4-dev \ 65 # -- For Ruby -- 66 ruby \ 67 && apt-get clean 68 69 ################## 70 # C# dependencies 71 72 RUN wget www.nuget.org/NuGet.exe -O /usr/local/bin/nuget.exe 73 74 ################## 75 # Python dependencies 76 77 # These packages exist in apt-get, but their versions are too old, so we have 78 # to get updates from pip. 79 80 RUN pip install pip --upgrade 81 RUN pip install virtualenv tox yattag 82 83 84 ################## 85 # Ruby dependencies 86 87 # Install rvm 88 RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 89 RUN \curl -sSL https://get.rvm.io | bash -s stable 90 91 # Install Ruby 2.1 92 RUN /bin/bash -l -c "rvm install ruby-2.1" 93 RUN /bin/bash -l -c "rvm use --default ruby-2.1" 94 RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc" 95 RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" 96 RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.1' >> ~/.bashrc" 97 RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc" 98 99 ################## 100 # Java dependencies 101 102 # This step requires compiling protoc. :( 103 104 ENV MAVEN_REPO /var/maven_local_repository 105 ENV MVN mvn --batch-mode 106 107 RUN cd /tmp && \ 108 git clone https://github.com/google/protobuf.git && \ 109 cd protobuf && \ 110 ./autogen.sh && \ 111 ./configure && \ 112 make -j6 && \ 113 cd java && \ 114 $MVN install dependency:go-offline -Dmaven.repo.local=$MAVEN_REPO -P lite && \ 115 $MVN install dependency:go-offline -Dmaven.repo.local=$MAVEN_REPO && \ 116 cd ../javanano && \ 117 $MVN install dependency:go-offline -Dmaven.repo.local=$MAVEN_REPO 118 119 ################## 120 # Prepare ccache 121 122 RUN ln -s /usr/bin/ccache /usr/local/bin/gcc 123 RUN ln -s /usr/bin/ccache /usr/local/bin/g++ 124 RUN ln -s /usr/bin/ccache /usr/local/bin/cc 125 RUN ln -s /usr/bin/ccache /usr/local/bin/c++ 126 RUN ln -s /usr/bin/ccache /usr/local/bin/clang 127 RUN ln -s /usr/bin/ccache /usr/local/bin/clang++ 128 129 # Define the default command. 130 CMD ["bash"] 131