Dockerfile 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. # Copyright 2015 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. #====================
  52. # run_tests.py python dependencies
  53. # Basic python dependencies to be able to run tools/run_tests python scripts
  54. # These dependencies are not sufficient to build gRPC Python, gRPC Python
  55. # deps are defined elsewhere (e.g. python_deps.include)
  56. RUN apt-get update && apt-get install -y \
  57. python3 \
  58. python3-pip \
  59. python3-setuptools \
  60. python3-yaml \
  61. && apt-get clean
  62. # use pinned version of pip to avoid sudden breakages
  63. RUN python3 -m pip install --upgrade pip==19.3.1
  64. # TODO(jtattermusch): currently six is needed for tools/run_tests scripts
  65. # but since our python2 usage is deprecated, we should get rid of it.
  66. RUN python3 -m pip install six==1.16.0
  67. # Google Cloud Platform API libraries
  68. # These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
  69. RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
  70. #================
  71. # C# dependencies
  72. # cmake >=3.6 needed to build grpc_csharp_ext
  73. RUN apt-get update && apt-get install -y cmake && apt-get clean
  74. # Install mono
  75. RUN apt-get update && apt-get install -y apt-transport-https dirmngr && apt-get clean
  76. RUN apt-key adv --no-tty --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
  77. RUN echo "deb https://download.mono-project.com/repo/debian stable-buster main" | tee /etc/apt/sources.list.d/mono-official-stable.list
  78. RUN apt-get update && apt-get install -y \
  79. mono-devel \
  80. ca-certificates-mono \
  81. nuget \
  82. && apt-get clean
  83. # Install .NET Core 3.1 (to be able to run the netcoreapp3.1 targets)
  84. RUN curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/3.1.415/dotnet-sdk-3.1.415-linux-x64.tar.gz \
  85. && mkdir -p /usr/share/dotnet \
  86. && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
  87. && rm dotnet.tar.gz
  88. # Install .NET 6
  89. RUN curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100/dotnet-sdk-6.0.100-linux-x64.tar.gz \
  90. && mkdir -p /usr/share/dotnet \
  91. && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
  92. && rm dotnet.tar.gz
  93. # Make sure "dotnet" is on PATH
  94. RUN ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
  95. # Trigger the population of the local package cache
  96. ENV NUGET_XMLDOC_MODE skip
  97. RUN mkdir warmup \
  98. && cd warmup \
  99. && dotnet new \
  100. && cd .. \
  101. && rm -rf warmup
  102. #=================
  103. # Install ccache
  104. # Install ccache from source since ccache 3.x packaged with most linux distributions
  105. # does not support Redis backend for caching.
  106. RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
  107. && tar -zxf ccache.tar.gz \
  108. && cd ccache-4.5.1 \
  109. && mkdir build && cd build \
  110. && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
  111. && make -j4 && make install \
  112. && cd ../.. \
  113. && rm -rf ccache-4.5.1 ccache.tar.gz
  114. RUN mkdir /var/local/jenkins
  115. # Define the default command.
  116. CMD ["bash"]