Dockerfile 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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 wget http://am1.php.net/get/php-5.5.38.tar.bz2/from/this/mirror
  57. RUN mv mirror php-5.5.38.tar.bz2
  58. RUN tar -xvf php-5.5.38.tar.bz2
  59. RUN cd php-5.5.38 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-5.5-zts && \
  60. make && make install && make clean && cd ..
  61. RUN cd php-5.5.38 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-5.5 && \
  62. make && make install && make clean && cd ..
  63. RUN wget http://am1.php.net/get/php-5.6.30.tar.bz2/from/this/mirror
  64. RUN mv mirror php-5.6.30.tar.bz2
  65. RUN tar -xvf php-5.6.30.tar.bz2
  66. RUN cd php-5.6.30 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-5.6-zts && \
  67. make && make install && cd ..
  68. RUN cd php-5.6.30 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-5.6 && \
  69. make && make install && cd ..
  70. RUN wget http://am1.php.net/get/php-7.0.18.tar.bz2/from/this/mirror
  71. RUN mv mirror php-7.0.18.tar.bz2
  72. RUN tar -xvf php-7.0.18.tar.bz2
  73. RUN cd php-7.0.18 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-7.0-zts && \
  74. make && make install && cd ..
  75. RUN cd php-7.0.18 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-7.0 && \
  76. make && make install && cd ..
  77. RUN wget http://am1.php.net/get/php-7.1.4.tar.bz2/from/this/mirror
  78. RUN mv mirror php-7.1.4.tar.bz2
  79. RUN tar -xvf php-7.1.4.tar.bz2
  80. RUN cd php-7.1.4 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-7.1-zts && \
  81. make && make install && cd ..
  82. RUN cd php-7.1.4 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-7.1 && \
  83. make && make install && cd ..
  84. RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
  85. RUN php composer-setup.php
  86. RUN mv composer.phar /usr/bin/composer
  87. RUN php -r "unlink('composer-setup.php');"
  88. RUN composer config -g -- disable-tls true
  89. RUN composer config -g -- secure-http false
  90. RUN cd /tmp && \
  91. git clone https://github.com/google/protobuf.git && \
  92. cd protobuf/php && \
  93. git reset --hard 49b44bff2b6257a119f9c6a342d6151c736586b8 && \
  94. ln -sfn /usr/local/php-5.5/bin/php /usr/bin/php && \
  95. ln -sfn /usr/local/php-5.5/bin/php-config /usr/bin/php-config && \
  96. ln -sfn /usr/local/php-5.5/bin/phpize /usr/bin/phpize && \
  97. composer install && \
  98. mv vendor /usr/local/vendor-5.5 && \
  99. ln -sfn /usr/local/php-5.6/bin/php /usr/bin/php && \
  100. ln -sfn /usr/local/php-5.6/bin/php-config /usr/bin/php-config && \
  101. ln -sfn /usr/local/php-5.6/bin/phpize /usr/bin/phpize && \
  102. composer install && \
  103. mv vendor /usr/local/vendor-5.6 && \
  104. ln -sfn /usr/local/php-7.0/bin/php /usr/bin/php && \
  105. ln -sfn /usr/local/php-7.0/bin/php-config /usr/bin/php-config && \
  106. ln -sfn /usr/local/php-7.0/bin/phpize /usr/bin/phpize && \
  107. composer install && \
  108. mv vendor /usr/local/vendor-7.0 && \
  109. ln -sfn /usr/local/php-7.1/bin/php /usr/bin/php && \
  110. ln -sfn /usr/local/php-7.1/bin/php-config /usr/bin/php-config && \
  111. ln -sfn /usr/local/php-7.1/bin/phpize /usr/bin/phpize && \
  112. composer install && \
  113. mv vendor /usr/local/vendor-7.1
  114. ##################
  115. # Python dependencies
  116. # These packages exist in apt-get, but their versions are too old, so we have
  117. # to get updates from pip.
  118. RUN pip install pip --upgrade
  119. RUN pip install virtualenv tox yattag
  120. ##################
  121. # Prepare ccache
  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. # Define the default command.
  129. CMD ["bash"]