| 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 |
|
| 15 |
FROM debian:11 |
| 16 |
|
| 17 |
#================= |
| 18 |
# Basic C core dependencies |
| 19 |
|
| 20 |
# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md |
| 21 |
RUN apt-get update && apt-get install -y \ |
| 22 |
build-essential \ |
| 23 |
autoconf \ |
| 24 |
libtool \ |
| 25 |
pkg-config \ |
| 26 |
&& apt-get clean |
| 27 |
|
| 28 |
# GCC |
| 29 |
RUN apt-get update && apt-get install -y \ |
| 30 |
gcc \ |
| 31 |
g++ \ |
| 32 |
&& apt-get clean |
| 33 |
|
| 34 |
# libc6 |
| 35 |
RUN apt-get update && apt-get install -y \ |
| 36 |
libc6 \ |
| 37 |
libc6-dbg \ |
| 38 |
libc6-dev \ |
| 39 |
&& apt-get clean |
| 40 |
|
| 41 |
# Tools |
| 42 |
RUN apt-get update && apt-get install -y \ |
| 43 |
bzip2 \ |
| 44 |
curl \ |
| 45 |
dnsutils \ |
| 46 |
git \ |
| 47 |
lcov \ |
| 48 |
make \ |
| 49 |
strace \ |
| 50 |
time \ |
| 51 |
unzip \ |
| 52 |
wget \ |
| 53 |
zip \ |
| 54 |
&& apt-get clean |
| 55 |
|
| 56 |
#==================== |
| 57 |
# run_tests.py python dependencies |
| 58 |
|
| 59 |
# Basic python dependencies to be able to run tools/run_tests python scripts |
| 60 |
# These dependencies are not sufficient to build gRPC Python, gRPC Python |
| 61 |
# deps are defined elsewhere (e.g. python_deps.include) |
| 62 |
RUN apt-get update && apt-get install -y \ |
| 63 |
python3 \ |
| 64 |
python3-pip \ |
| 65 |
python3-setuptools \ |
| 66 |
python3-yaml \ |
| 67 |
&& apt-get clean |
| 68 |
|
| 69 |
# use pinned version of pip to avoid sudden breakages |
| 70 |
RUN python3 -m pip install --upgrade pip==19.3.1 |
| 71 |
|
| 72 |
# TODO(jtattermusch): currently six is needed for tools/run_tests scripts |
| 73 |
# but since our python2 usage is deprecated, we should get rid of it. |
| 74 |
RUN python3 -m pip install six==1.16.0 |
| 75 |
|
| 76 |
# Google Cloud Platform API libraries |
| 77 |
# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) |
| 78 |
RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 |
| 79 |
|
| 80 |
|
| 81 |
#================ |
| 82 |
# C# dependencies |
| 83 |
|
| 84 |
# cmake >=3.6 needed to build grpc_csharp_ext |
| 85 |
RUN apt-get update && apt-get install -y cmake && apt-get clean |
| 86 |
|
| 87 |
# Install mono |
| 88 |
RUN apt-get update && apt-get install -y apt-transport-https dirmngr && apt-get clean |
| 89 |
RUN apt-key adv --no-tty --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF |
| 90 |
RUN echo "deb https://download.mono-project.com/repo/debian stable-buster main" | tee /etc/apt/sources.list.d/mono-official-stable.list |
| 91 |
RUN apt-get update && apt-get install -y \ |
| 92 |
mono-devel \ |
| 93 |
ca-certificates-mono \ |
| 94 |
nuget \ |
| 95 |
&& apt-get clean |
| 96 |
|
| 97 |
# Install .NET Core 3.1 (to be able to run the netcoreapp3.1 targets) |
| 98 |
RUN DOTNET_DOWNLOAD_VERSION=3.1.415 \ |
| 99 |
&& DOTNET_DOWNLOAD_ARCH="$(uname -m | sed s/x86_64/x64/ | sed s/aarch64/arm64/)" \ |
| 100 |
&& curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_DOWNLOAD_VERSION/dotnet-sdk-$DOTNET_DOWNLOAD_VERSION-linux-$DOTNET_DOWNLOAD_ARCH.tar.gz \ |
| 101 |
&& mkdir -p /usr/share/dotnet \ |
| 102 |
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \ |
| 103 |
&& rm dotnet.tar.gz |
| 104 |
|
| 105 |
# Install .NET 6 |
| 106 |
RUN DOTNET_DOWNLOAD_VERSION=6.0.100 \ |
| 107 |
&& DOTNET_DOWNLOAD_ARCH="$(uname -m | sed s/x86_64/x64/ | sed s/aarch64/arm64/)" \ |
| 108 |
&& curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_DOWNLOAD_VERSION/dotnet-sdk-$DOTNET_DOWNLOAD_VERSION-linux-$DOTNET_DOWNLOAD_ARCH.tar.gz \ |
| 109 |
&& mkdir -p /usr/share/dotnet \ |
| 110 |
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \ |
| 111 |
&& rm dotnet.tar.gz |
| 112 |
|
| 113 |
# Make sure "dotnet" is on PATH |
| 114 |
RUN ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet |
| 115 |
|
| 116 |
# Trigger the population of the local package cache |
| 117 |
ENV NUGET_XMLDOC_MODE skip |
| 118 |
RUN mkdir warmup \ |
| 119 |
&& cd warmup \ |
| 120 |
&& dotnet new \ |
| 121 |
&& cd .. \ |
| 122 |
&& rm -rf warmup |
| 123 |
|
| 124 |
#================= |
| 125 |
# Install ccache |
| 126 |
|
| 127 |
# Install ccache from source since ccache 3.x packaged with most linux distributions |
| 128 |
# does not support Redis backend for caching. |
| 129 |
RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \ |
| 130 |
&& tar -zxf ccache.tar.gz \ |
| 131 |
&& cd ccache-4.5.1 \ |
| 132 |
&& mkdir build && cd build \ |
| 133 |
&& cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \ |
| 134 |
&& make -j4 && make install \ |
| 135 |
&& cd ../.. \ |
| 136 |
&& rm -rf ccache-4.5.1 ccache.tar.gz |
| 137 |
|
| 138 |
|
| 139 |
RUN mkdir /var/local/jenkins |
| 140 |
|
| 141 |
|
| 142 |
# Define the default command. |
| 143 |
CMD ["bash"] |