Dockerfile 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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 32bit/debian:latest
  10. # Apt source for php
  11. RUN echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu trusty main" | tee /etc/apt/sources.list.d/various-php.list && \
  12. apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F4FCBB07
  13. # Install dependencies. We start with the basic ones require to build protoc
  14. # and the C++ build
  15. RUN apt-get clean && apt-get update && apt-get install -y --force-yes \
  16. autoconf \
  17. autotools-dev \
  18. build-essential \
  19. bzip2 \
  20. ccache \
  21. curl \
  22. gcc \
  23. git \
  24. libc6 \
  25. libc6-dbg \
  26. libc6-dev \
  27. libgtest-dev \
  28. libtool \
  29. make \
  30. parallel \
  31. time \
  32. wget \
  33. unzip \
  34. # -- For python --
  35. python-setuptools \
  36. python-pip \
  37. python-dev \
  38. # -- For C++ benchmarks --
  39. cmake \
  40. # -- For PHP --
  41. php5.5 \
  42. php5.5-dev \
  43. php5.5-xml \
  44. php5.6 \
  45. php5.6-dev \
  46. php5.6-xml \
  47. php7.0 \
  48. php7.0-dev \
  49. php7.0-xml \
  50. phpunit \
  51. valgrind \
  52. libxml2-dev \
  53. && apt-get clean
  54. ##################
  55. # PHP dependencies.
  56. RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
  57. RUN php composer-setup.php
  58. RUN mv composer.phar /usr/bin/composer
  59. RUN php -r "unlink('composer-setup.php');"
  60. RUN cd /tmp && \
  61. git clone https://github.com/google/protobuf.git && \
  62. cd protobuf/php && \
  63. git reset --hard 6b27c1f981a9a93918e4039f236ead27165a8e91 && \
  64. ln -sfn /usr/bin/php5.5 /usr/bin/php && \
  65. ln -sfn /usr/bin/php-config5.5 /usr/bin/php-config && \
  66. ln -sfn /usr/bin/phpize5.5 /usr/bin/phpize && \
  67. composer install && \
  68. mv vendor /usr/local/vendor-5.5 && \
  69. ln -sfn /usr/bin/php5.6 /usr/bin/php && \
  70. ln -sfn /usr/bin/php-config5.6 /usr/bin/php-config && \
  71. ln -sfn /usr/bin/phpize5.6 /usr/bin/phpize && \
  72. composer install && \
  73. mv vendor /usr/local/vendor-5.6 && \
  74. ln -sfn /usr/bin/php7.0 /usr/bin/php && \
  75. ln -sfn /usr/bin/php-config7.0 /usr/bin/php-config && \
  76. ln -sfn /usr/bin/phpize7.0 /usr/bin/phpize && \
  77. composer install && \
  78. mv vendor /usr/local/vendor-7.0
  79. RUN wget http://am1.php.net/get/php-5.5.38.tar.bz2/from/this/mirror
  80. RUN mv mirror php-5.5.38.tar.bz2
  81. RUN tar -xvf php-5.5.38.tar.bz2
  82. RUN cd php-5.5.38 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-5.5-zts && \
  83. make && make install && make clean && cd ..
  84. RUN cd php-5.5.38 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-5.5 && \
  85. make && make install && make clean && cd ..
  86. RUN wget http://am1.php.net/get/php-5.6.30.tar.bz2/from/this/mirror
  87. RUN mv mirror php-5.6.30.tar.bz2
  88. RUN tar -xvf php-5.6.30.tar.bz2
  89. RUN cd php-5.6.30 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-5.6-zts && \
  90. make && make install && cd ..
  91. RUN cd php-5.6.30 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-5.6 && \
  92. make && make install && cd ..
  93. RUN wget http://am1.php.net/get/php-7.0.18.tar.bz2/from/this/mirror
  94. RUN mv mirror php-7.0.18.tar.bz2
  95. RUN tar -xvf php-7.0.18.tar.bz2
  96. RUN cd php-7.0.18 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-7.0-zts && \
  97. make && make install && cd ..
  98. RUN cd php-7.0.18 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-7.0 && \
  99. make && make install && cd ..
  100. ##################
  101. # Python dependencies
  102. # These packages exist in apt-get, but their versions are too old, so we have
  103. # to get updates from pip.
  104. RUN pip install pip --upgrade
  105. RUN pip install virtualenv tox yattag
  106. ##################
  107. # Prepare ccache
  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. # Define the default command.
  115. CMD ["bash"]