| 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 mkdir /var/local/jenkins |
| 58 |
|
| 59 |
|
| 60 |
#================= |
| 61 |
# Compile CPython 3.6.15 from source |
| 62 |
|
| 63 |
RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean |
| 64 |
RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean |
| 65 |
|
| 66 |
RUN cd /tmp && \ |
| 67 |
wget -q https://www.python.org/ftp/python/3.6.15/Python-3.6.15.tgz && \ |
| 68 |
tar xzvf Python-3.6.15.tgz && \ |
| 69 |
cd Python-3.6.15 && \ |
| 70 |
./configure && \ |
| 71 |
make -j4 && \ |
| 72 |
make install |
| 73 |
|
| 74 |
RUN cd /tmp && \ |
| 75 |
echo "f9e6f91c754a604f4fc6f6c7683723fb Python-3.6.15.tgz" > checksum.md5 && \ |
| 76 |
md5sum -c checksum.md5 |
| 77 |
|
| 78 |
RUN python3.6 -m ensurepip && \ |
| 79 |
python3.6 -m pip install coverage |
| 80 |
|
| 81 |
#================= |
| 82 |
# Compile CPython 3.7.13 from source |
| 83 |
|
| 84 |
RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean |
| 85 |
RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean |
| 86 |
|
| 87 |
RUN cd /tmp && \ |
| 88 |
wget -q https://www.python.org/ftp/python/3.7.13/Python-3.7.13.tgz && \ |
| 89 |
tar xzvf Python-3.7.13.tgz && \ |
| 90 |
cd Python-3.7.13 && \ |
| 91 |
./configure && \ |
| 92 |
make -j4 && \ |
| 93 |
make install |
| 94 |
|
| 95 |
RUN cd /tmp && \ |
| 96 |
echo "e0d3321026d4a5f3a3890b5d821ad762 Python-3.7.13.tgz" > checksum.md5 && \ |
| 97 |
md5sum -c checksum.md5 |
| 98 |
|
| 99 |
RUN python3.7 -m ensurepip && \ |
| 100 |
python3.7 -m pip install coverage |
| 101 |
|
| 102 |
#================= |
| 103 |
# Compile CPython 3.8.13 from source |
| 104 |
|
| 105 |
RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean |
| 106 |
RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean |
| 107 |
|
| 108 |
RUN cd /tmp && \ |
| 109 |
wget -q https://www.python.org/ftp/python/3.8.13/Python-3.8.13.tgz && \ |
| 110 |
tar xzvf Python-3.8.13.tgz && \ |
| 111 |
cd Python-3.8.13 && \ |
| 112 |
./configure && \ |
| 113 |
make -j4 && \ |
| 114 |
make install |
| 115 |
|
| 116 |
RUN cd /tmp && \ |
| 117 |
echo "3c49180c6b43df3519849b7e390af0b9 Python-3.8.13.tgz" > checksum.md5 && \ |
| 118 |
md5sum -c checksum.md5 |
| 119 |
|
| 120 |
RUN python3.8 -m ensurepip && \ |
| 121 |
python3.8 -m pip install coverage |
| 122 |
|
| 123 |
#================= |
| 124 |
# Compile CPython 3.10.3 from source |
| 125 |
|
| 126 |
RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean |
| 127 |
RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean |
| 128 |
|
| 129 |
RUN cd /tmp && \ |
| 130 |
wget -q https://www.python.org/ftp/python/3.10.3/Python-3.10.3.tgz && \ |
| 131 |
tar xzvf Python-3.10.3.tgz && \ |
| 132 |
cd Python-3.10.3 && \ |
| 133 |
./configure && \ |
| 134 |
make -j4 && \ |
| 135 |
make install |
| 136 |
|
| 137 |
RUN cd /tmp && \ |
| 138 |
echo "f276ffcd05bccafe46da023d0a5bb04a Python-3.10.3.tgz" > checksum.md5 && \ |
| 139 |
md5sum -c checksum.md5 |
| 140 |
|
| 141 |
RUN python3.10 -m ensurepip && \ |
| 142 |
python3.10 -m pip install coverage |
| 143 |
|
| 144 |
|
| 145 |
# 3.9 is the default python3 version on debian11 |
| 146 |
RUN apt-get update && apt-get install -y python3.9 python3.9-dev python3-pip |
| 147 |
|
| 148 |
# for Python test coverage reporting |
| 149 |
RUN python3.9 -m pip install coverage |
| 150 |
|
| 151 |
# Google Cloud Platform API libraries |
| 152 |
# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) |
| 153 |
RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 |
| 154 |
|
| 155 |
|
| 156 |
#================= |
| 157 |
# Install cmake |
| 158 |
# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement. |
| 159 |
|
| 160 |
RUN apt-get update && apt-get install -y cmake && apt-get clean |
| 161 |
|
| 162 |
#================= |
| 163 |
# Install ccache |
| 164 |
|
| 165 |
# Install ccache from source since ccache 3.x packaged with most linux distributions |
| 166 |
# does not support Redis backend for caching. |
| 167 |
RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \ |
| 168 |
&& tar -zxf ccache.tar.gz \ |
| 169 |
&& cd ccache-4.5.1 \ |
| 170 |
&& mkdir build && cd build \ |
| 171 |
&& cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \ |
| 172 |
&& make -j4 && make install \ |
| 173 |
&& cd ../.. \ |
| 174 |
&& rm -rf ccache-4.5.1 ccache.tar.gz |
| 175 |
|