Dockerfile 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. # Copyright 2015, Google Inc.
  2. # All rights reserved.
  3. #
  4. # Redistribution and use in source and binary forms, with or without
  5. # modification, are permitted provided that the following conditions are
  6. # met:
  7. #
  8. # * Redistributions of source code must retain the above copyright
  9. # notice, this list of conditions and the following disclaimer.
  10. # * Redistributions in binary form must reproduce the above
  11. # copyright notice, this list of conditions and the following disclaimer
  12. # in the documentation and/or other materials provided with the
  13. # distribution.
  14. # * Neither the name of Google Inc. nor the names of its
  15. # contributors may be used to endorse or promote products derived from
  16. # this software without specific prior written permission.
  17. #
  18. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  22. # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  23. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  24. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  26. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  28. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. # Base Dockerfile for gRPC dev images
  30. FROM debian:latest
  31. # Apt source for old Python versions.
  32. RUN echo 'deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu trusty main' > /etc/apt/sources.list.d/deadsnakes.list && \
  33. apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DB82666C
  34. # Apt source for Oracle Java.
  35. run echo 'deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main' > /etc/apt/sources.list.d/webupd8team-java-trusty.list && \
  36. apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 && \
  37. echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections
  38. # Apt source for Mono
  39. run echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list && \
  40. echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list && \
  41. apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
  42. # Install dependencies. We start with the basic ones require to build protoc
  43. # and the C++ build
  44. RUN apt-get update && apt-get install -y \
  45. autoconf \
  46. autotools-dev \
  47. build-essential \
  48. bzip2 \
  49. ccache \
  50. curl \
  51. gcc \
  52. git \
  53. libc6 \
  54. libc6-dbg \
  55. libc6-dev \
  56. libgtest-dev \
  57. libtool \
  58. make \
  59. parallel \
  60. wget \
  61. # -- For csharp --
  62. mono-devel \
  63. referenceassemblies-pcl \
  64. nunit \
  65. # -- For all Java builds -- \
  66. maven \
  67. # -- For java_jdk6 -- \
  68. # oops! not in jessie. too old? openjdk-6-jdk \
  69. # -- For java_jdk7 -- \
  70. openjdk-7-jdk \
  71. # -- For java_oracle7 -- \
  72. oracle-java7-installer \
  73. # -- For python / python_cpp -- \
  74. python-setuptools \
  75. python-pip \
  76. python-dev \
  77. python2.6-dev \
  78. python3.3-dev \
  79. python3.4-dev \
  80. # -- For Ruby --
  81. ruby \
  82. && apt-get clean
  83. ##################
  84. # C# dependencies
  85. RUN wget www.nuget.org/NuGet.exe -O /usr/local/bin/nuget.exe
  86. ##################
  87. # Python dependencies
  88. # These packages exist in apt-get, but their versions are too old, so we have
  89. # to get updates from pip.
  90. RUN pip install pip --upgrade
  91. RUN pip install virtualenv tox yattag
  92. ##################
  93. # Ruby dependencies
  94. # Install rvm
  95. RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
  96. RUN \curl -sSL https://get.rvm.io | bash -s stable
  97. # Install Ruby 2.1
  98. RUN /bin/bash -l -c "rvm install ruby-2.1"
  99. RUN /bin/bash -l -c "rvm use --default ruby-2.1"
  100. RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
  101. RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
  102. RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.1' >> ~/.bashrc"
  103. RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc"
  104. ##################
  105. # Prepare ccache
  106. # We do this BEFORE the Java dependency step below, so the build of protoc
  107. # can benefit from it.
  108. RUN ln -s /usr/bin/ccache /usr/local/bin/gcc
  109. RUN ln -s /usr/bin/ccache /usr/local/bin/g++
  110. RUN ln -s /usr/bin/ccache /usr/local/bin/cc
  111. RUN ln -s /usr/bin/ccache /usr/local/bin/c++
  112. RUN ln -s /usr/bin/ccache /usr/local/bin/clang
  113. RUN ln -s /usr/bin/ccache /usr/local/bin/clang++
  114. ##################
  115. # Java dependencies
  116. # This step requires compiling protoc. :(
  117. ENV MAVEN_REPO /var/maven_local_repository
  118. ENV MVN mvn --batch-mode
  119. RUN cd /tmp && \
  120. git clone https://github.com/google/protobuf.git && \
  121. cd protobuf && \
  122. ./autogen.sh && \
  123. ./configure && \
  124. make -j6 && \
  125. cd java && \
  126. $MVN install dependency:go-offline -Dmaven.repo.local=$MAVEN_REPO -P lite && \
  127. $MVN install dependency:go-offline -Dmaven.repo.local=$MAVEN_REPO && \
  128. cd ../javanano && \
  129. $MVN install dependency:go-offline -Dmaven.repo.local=$MAVEN_REPO
  130. # Define the default command.
  131. CMD ["bash"]