Dockerfile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. # Copyright 2021 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. RUN apt-get --allow-releaseinfo-change update
  16. #=================
  17. # Basic C core dependencies
  18. # C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
  19. RUN apt-get update && apt-get install -y \
  20. build-essential \
  21. autoconf \
  22. libtool \
  23. pkg-config \
  24. && apt-get clean
  25. # GCC
  26. RUN apt-get update && apt-get install -y \
  27. gcc \
  28. gcc-multilib \
  29. g++ \
  30. g++-multilib \
  31. && apt-get clean
  32. # libc6
  33. RUN apt-get update && apt-get install -y \
  34. libc6 \
  35. libc6-dbg \
  36. libc6-dev \
  37. && apt-get clean
  38. # Tools
  39. RUN apt-get update && apt-get install -y \
  40. bzip2 \
  41. curl \
  42. dnsutils \
  43. git \
  44. lcov \
  45. make \
  46. strace \
  47. time \
  48. unzip \
  49. wget \
  50. zip \
  51. && apt-get clean
  52. #====================
  53. # run_tests.py python dependencies
  54. # Basic python dependencies to be able to run tools/run_tests python scripts
  55. # These dependencies are not sufficient to build gRPC Python, gRPC Python
  56. # deps are defined elsewhere (e.g. python_deps.include)
  57. RUN apt-get update && apt-get install -y \
  58. python3 \
  59. python3-pip \
  60. python3-setuptools \
  61. python3-yaml \
  62. && apt-get clean
  63. # use pinned version of pip to avoid sudden breakages
  64. RUN python3 -m pip install --upgrade pip==19.3.1
  65. # TODO(jtattermusch): currently six is needed for tools/run_tests scripts
  66. # but since our python2 usage is deprecated, we should get rid of it.
  67. RUN python3 -m pip install six==1.16.0
  68. # Google Cloud Platform API libraries
  69. # These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
  70. RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
  71. #=================
  72. # C++ dependencies
  73. RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean
  74. #=================
  75. # Install cmake
  76. # Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
  77. RUN apt-get update && apt-get install -y cmake && apt-get clean
  78. #=================
  79. # Install ccache
  80. # Install ccache from source since ccache 3.x packaged with most linux distributions
  81. # does not support Redis backend for caching.
  82. RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
  83. && tar -zxf ccache.tar.gz \
  84. && cd ccache-4.5.1 \
  85. && mkdir build && cd build \
  86. && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
  87. && make -j4 && make install \
  88. && cd ../.. \
  89. && rm -rf ccache-4.5.1 ccache.tar.gz
  90. RUN mkdir /var/local/jenkins
  91. # Install openssl 1.0.2 from source
  92. RUN apt-get update && apt-get install -y build-essential zlib1g-dev
  93. RUN cd /tmp && \
  94. wget --no-check-certificate https://www.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz && \
  95. tar -xf openssl-1.0.2u.tar.gz && \
  96. cd openssl-1.0.2u && \
  97. ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib && \
  98. make -j 4 && \
  99. make install && \
  100. rm -rf /tmp/openssl-1.0.2u*
  101. ENV OPENSSL_ROOT_DIR=/usr/local/ssl
  102. # Define the default command.
  103. CMD ["bash"]