Dockerfile 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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. # Base Dockerfile for gRPC dev images
  9. FROM debian:latest
  10. # Apt source for old Python versions.
  11. RUN echo 'deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu trusty main' > /etc/apt/sources.list.d/deadsnakes.list && \
  12. apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DB82666C
  13. # Apt source for Oracle Java.
  14. run echo 'deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main' > /etc/apt/sources.list.d/webupd8team-java-trusty.list && \
  15. apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 && \
  16. echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections
  17. # Apt source for Mono
  18. run echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list && \
  19. echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list && \
  20. apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
  21. # Install dependencies. We start with the basic ones require to build protoc
  22. # and the C++ build
  23. RUN apt-get update && apt-get install -y \
  24. autoconf \
  25. autotools-dev \
  26. build-essential \
  27. bzip2 \
  28. ccache \
  29. curl \
  30. gcc \
  31. git \
  32. libc6 \
  33. libc6-dbg \
  34. libc6-dev \
  35. libgtest-dev \
  36. libtool \
  37. make \
  38. parallel \
  39. time \
  40. wget \
  41. # -- For csharp --
  42. mono-devel \
  43. referenceassemblies-pcl \
  44. nunit \
  45. # -- For all Java builds -- \
  46. maven \
  47. # -- For java_jdk6 -- \
  48. # oops! not in jessie. too old? openjdk-6-jdk \
  49. # -- For java_jdk7 -- \
  50. openjdk-7-jdk \
  51. # -- For java_oracle7 -- \
  52. oracle-java7-installer \
  53. # -- For python / python_cpp -- \
  54. python-setuptools \
  55. python-pip \
  56. python-dev \
  57. python2.6-dev \
  58. python3.3-dev \
  59. python3.4-dev \
  60. # -- For Ruby --
  61. ruby \
  62. && apt-get clean
  63. ##################
  64. # C# dependencies
  65. RUN wget www.nuget.org/NuGet.exe -O /usr/local/bin/nuget.exe
  66. ##################
  67. # Python dependencies
  68. # These packages exist in apt-get, but their versions are too old, so we have
  69. # to get updates from pip.
  70. RUN pip install pip --upgrade
  71. RUN pip install virtualenv tox yattag
  72. ##################
  73. # Ruby dependencies
  74. # Install rvm
  75. RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
  76. RUN \curl -sSL https://get.rvm.io | bash -s stable
  77. # Install Ruby 2.1
  78. RUN /bin/bash -l -c "rvm install ruby-2.1"
  79. RUN /bin/bash -l -c "rvm use --default ruby-2.1"
  80. RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
  81. RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
  82. RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.1' >> ~/.bashrc"
  83. RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc"
  84. ##################
  85. # Java dependencies
  86. # This step requires compiling protoc. :(
  87. ENV MAVEN_REPO /var/maven_local_repository
  88. ENV MVN mvn --batch-mode
  89. RUN cd /tmp && \
  90. git clone https://github.com/google/protobuf.git && \
  91. cd protobuf && \
  92. ./autogen.sh && \
  93. ./configure && \
  94. make -j6 && \
  95. cd java && \
  96. $MVN install dependency:go-offline -Dmaven.repo.local=$MAVEN_REPO -P lite && \
  97. $MVN install dependency:go-offline -Dmaven.repo.local=$MAVEN_REPO && \
  98. cd ../javanano && \
  99. $MVN install dependency:go-offline -Dmaven.repo.local=$MAVEN_REPO
  100. ##################
  101. # Prepare ccache
  102. RUN ln -s /usr/bin/ccache /usr/local/bin/gcc
  103. RUN ln -s /usr/bin/ccache /usr/local/bin/g++
  104. RUN ln -s /usr/bin/ccache /usr/local/bin/cc
  105. RUN ln -s /usr/bin/ccache /usr/local/bin/c++
  106. RUN ln -s /usr/bin/ccache /usr/local/bin/clang
  107. RUN ln -s /usr/bin/ccache /usr/local/bin/clang++
  108. # Define the default command.
  109. CMD ["bash"]