• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
15FROM 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
21RUN apt-get update && apt-get install -y \
22  build-essential \
23  autoconf \
24  libtool \
25  pkg-config \
26  && apt-get clean
27
28# GCC
29RUN apt-get update && apt-get install -y \
30  gcc \
31  g++ \
32  && apt-get clean
33
34# libc6
35RUN apt-get update && apt-get install -y \
36  libc6 \
37  libc6-dbg \
38  libc6-dev \
39  && apt-get clean
40
41# Tools
42RUN 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# Setup git to access working directory across docker boundary.
58# This avoids the "fatal: detected dubious ownership in repository XYZ"
59# git error.
60
61RUN git config --global --add safe.directory '*'
62RUN git config --global protocol.file.allow always
63
64
65
66RUN mkdir /var/local/jenkins
67
68
69#=================
70# Compile CPython 3.7.13 from source
71
72RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev libsqlite3-dev && apt-get clean
73RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean
74
75RUN cd /tmp && \
76    wget -q https://www.python.org/ftp/python/3.7.13/Python-3.7.13.tgz && \
77    tar xzvf Python-3.7.13.tgz && \
78    cd Python-3.7.13 && \
79    ./configure && \
80    make -j4 && \
81    make install
82
83RUN cd /tmp && \
84    echo "e0d3321026d4a5f3a3890b5d821ad762 Python-3.7.13.tgz" > checksum.md5 && \
85    md5sum -c checksum.md5
86
87RUN python3.7 -m ensurepip && \
88    python3.7 -m pip install coverage
89
90#=================
91# Compile CPython 3.8.13 from source
92
93RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev libsqlite3-dev && apt-get clean
94RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean
95
96RUN cd /tmp && \
97    wget -q https://www.python.org/ftp/python/3.8.13/Python-3.8.13.tgz && \
98    tar xzvf Python-3.8.13.tgz && \
99    cd Python-3.8.13 && \
100    ./configure && \
101    make -j4 && \
102    make install
103
104RUN cd /tmp && \
105    echo "3c49180c6b43df3519849b7e390af0b9 Python-3.8.13.tgz" > checksum.md5 && \
106    md5sum -c checksum.md5
107
108RUN python3.8 -m ensurepip && \
109    python3.8 -m pip install coverage
110
111#=================
112# Compile CPython 3.10.3 from source
113
114RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev libsqlite3-dev && apt-get clean
115RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean
116
117RUN cd /tmp && \
118    wget -q https://www.python.org/ftp/python/3.10.3/Python-3.10.3.tgz && \
119    tar xzvf Python-3.10.3.tgz && \
120    cd Python-3.10.3 && \
121    ./configure && \
122    make -j4 && \
123    make install
124
125RUN cd /tmp && \
126    echo "f276ffcd05bccafe46da023d0a5bb04a Python-3.10.3.tgz" > checksum.md5 && \
127    md5sum -c checksum.md5
128
129RUN python3.10 -m ensurepip && \
130    python3.10 -m pip install coverage
131
132#=================
133# Compile CPython 3.11.4 from source
134
135RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev libsqlite3-dev && apt-get clean
136RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean
137
138RUN cd /tmp && \
139    wget -q https://www.python.org/ftp/python/3.11.4/Python-3.11.4.tgz && \
140    tar xzvf Python-3.11.4.tgz && \
141    cd Python-3.11.4 && \
142    ./configure && \
143    make -j4 && \
144    make install
145
146
147RUN cd /tmp && \
148    echo "bf6ec50f2f3bfa6ffbdb385286f2c628  Python-3.11.4.tgz" > checksum.md5 && \
149    md5sum -c checksum.md5
150
151RUN python3.11 -m ensurepip && \
152    python3.11 -m pip install coverage
153
154#=================
155# Compile CPython 3.12.0 from source
156
157RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev libsqlite3-dev && apt-get clean
158RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean
159
160RUN cd /tmp && \
161    wget -q https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tgz && \
162    tar xzvf Python-3.12.0.tgz && \
163    cd Python-3.12.0 && \
164    ./configure && \
165    make -j4 && \
166    make install
167
168
169RUN cd /tmp && \
170    echo "d6eda3e1399cef5dfde7c4f319b0596c  Python-3.12.0.tgz" > checksum.md5 && \
171    md5sum -c checksum.md5
172
173RUN python3.12 -m ensurepip && \
174    python3.12 -m pip install coverage
175
176
177# Python test coverage requires libsqlite3, and it have
178# to be installed before Python.
179RUN apt-get update && apt-get install -y libsqlite3-dev
180
181# 3.9 is the default python3 version on debian11
182RUN apt-get update && apt-get install -y python3.9 python3.9-dev python3-pip
183
184# for Python test coverage reporting
185RUN python3.9 -m pip install coverage
186
187# six is required by the run_tests.py test harness
188RUN python3.9 -m pip install six
189
190# Google Cloud Platform API libraries
191# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
192RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
193
194
195#=================
196# Install cmake
197# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
198
199RUN apt-get update && apt-get install -y cmake && apt-get clean
200
201#=================
202# Install ccache
203
204# Install ccache from source since ccache 3.x packaged with most linux distributions
205# does not support Redis backend for caching.
206RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.7.5/ccache-4.7.5.tar.gz \
207    && tar -zxf ccache.tar.gz \
208    && cd ccache-4.7.5 \
209    && mkdir build && cd build \
210    && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
211    && make -j4 && make install \
212    && cd ../.. \
213    && rm -rf ccache-4.7.5 ccache.tar.gz
214
215