Dockerfile 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. # Copyright 2018 The gRPC Authors
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. FROM debian:11
  15. #=================
  16. # Basic C core dependencies
  17. # C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
  18. RUN apt-get update && apt-get install -y \
  19. build-essential \
  20. autoconf \
  21. libtool \
  22. pkg-config \
  23. && apt-get clean
  24. # GCC
  25. RUN apt-get update && apt-get install -y \
  26. gcc \
  27. gcc-multilib \
  28. g++ \
  29. g++-multilib \
  30. && apt-get clean
  31. # libc6
  32. RUN apt-get update && apt-get install -y \
  33. libc6 \
  34. libc6-dbg \
  35. libc6-dev \
  36. && apt-get clean
  37. # Tools
  38. RUN apt-get update && apt-get install -y \
  39. bzip2 \
  40. curl \
  41. dnsutils \
  42. git \
  43. lcov \
  44. make \
  45. strace \
  46. time \
  47. unzip \
  48. wget \
  49. zip \
  50. && apt-get clean
  51. RUN mkdir /var/local/jenkins
  52. #=================
  53. # Compile CPython 3.6.9 from source
  54. RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean
  55. RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean
  56. RUN cd /tmp && \
  57. wget -q https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz && \
  58. tar xzvf Python-3.6.9.tgz && \
  59. cd Python-3.6.9 && \
  60. ./configure && \
  61. make -j4 && \
  62. make install
  63. RUN cd /tmp && \
  64. echo "ff7cdaef4846c89c1ec0d7b709bbd54d Python-3.6.9.tgz" > checksum.md5 && \
  65. md5sum -c checksum.md5
  66. RUN python3.6 -m ensurepip && \
  67. python3.6 -m pip install coverage
  68. #=================
  69. # Compile CPython 3.7.12 from source
  70. RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean
  71. RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean
  72. RUN cd /tmp && \
  73. wget -q https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz && \
  74. tar xzvf Python-3.7.12.tgz && \
  75. cd Python-3.7.12 && \
  76. ./configure && \
  77. make -j4 && \
  78. make install
  79. RUN cd /tmp && \
  80. echo "6fe83678c085a7735a943cf1e4d41c14 Python-3.7.12.tgz" > checksum.md5 && \
  81. md5sum -c checksum.md5
  82. RUN python3.7 -m ensurepip && \
  83. python3.7 -m pip install coverage
  84. #=================
  85. # Compile CPython 3.8.0b4 from source
  86. RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean
  87. RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean
  88. RUN cd /tmp && \
  89. wget -q https://www.python.org/ftp/python/3.8.0/Python-3.8.0b4.tgz && \
  90. tar xzvf Python-3.8.0b4.tgz && \
  91. cd Python-3.8.0b4 && \
  92. ./configure && \
  93. make -j4 && \
  94. make install
  95. RUN cd /tmp && \
  96. echo "b8f4f897df967014ddb42033b90c3058 Python-3.8.0b4.tgz" > checksum.md5 && \
  97. md5sum -c checksum.md5
  98. RUN python3.8 -m ensurepip && \
  99. python3.8 -m pip install coverage
  100. #=================
  101. # Compile CPython 3.10.2 from source
  102. RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean
  103. RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean
  104. RUN cd /tmp && \
  105. wget -q https://www.python.org/ftp/python/3.10.2/Python-3.10.2.tgz && \
  106. tar xzvf Python-3.10.2.tgz && \
  107. cd Python-3.10.2 && \
  108. ./configure && \
  109. make -j4 && \
  110. make install
  111. RUN cd /tmp && \
  112. echo "67c92270be6701f4a6fed57c4530139b Python-3.10.2.tgz" > checksum.md5 && \
  113. md5sum -c checksum.md5
  114. RUN python3.10 -m ensurepip && \
  115. python3.10 -m pip install coverage
  116. # 3.9 is the default python3 version on debian11
  117. RUN apt-get update && apt-get install -y python3.9 python3.9-dev python3-pip
  118. # for Python test coverage reporting
  119. RUN python3.9 -m pip install coverage
  120. # Google Cloud Platform API libraries
  121. # These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
  122. RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
  123. #=================
  124. # Install cmake
  125. # Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
  126. RUN apt-get update && apt-get install -y cmake && apt-get clean
  127. #=================
  128. # Install ccache
  129. # Install ccache from source since ccache 3.x packaged with most linux distributions
  130. # does not support Redis backend for caching.
  131. RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
  132. && tar -zxf ccache.tar.gz \
  133. && cd ccache-4.5.1 \
  134. && mkdir build && cd build \
  135. && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
  136. && make -j4 && make install \
  137. && cd ../.. \
  138. && rm -rf ccache-4.5.1 ccache.tar.gz