• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2016 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# debian 11 = "bullseye"
16FROM php:7.3-zts-bullseye
17
18RUN apt-get update && apt-get install -y \
19  autoconf automake build-essential git libtool curl \
20  zlib1g-dev \
21  && apt-get clean
22
23#=================
24# Setup git to access working directory across docker boundary.
25# This avoids the "fatal: detected dubious ownership in repository XYZ"
26# git error.
27
28RUN git config --global --add safe.directory '*'
29RUN git config --global protocol.file.allow always
30
31
32# install php pthreads from source
33# TODO(jtattermusch): is this really needed?
34# See https://github.com/grpc/grpc/pull/23056
35WORKDIR /tmp
36RUN git clone https://github.com/krakjoe/pthreads
37RUN cd pthreads && \
38  phpize && \
39  ./configure && \
40  make && \
41  make install
42
43#====================
44# run_tests.py python dependencies
45
46# Basic python dependencies to be able to run tools/run_tests python scripts
47# These dependencies are not sufficient to build gRPC Python, gRPC Python
48# deps are defined elsewhere (e.g. python_deps.include)
49RUN apt-get update && apt-get install -y \
50  python3 \
51  python3-pip \
52  python3-setuptools \
53  python3-yaml \
54  && apt-get clean
55
56# use pinned version of pip to avoid sudden breakages
57RUN python3 -m pip install --upgrade pip==19.3.1
58
59# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
60# but since our python2 usage is deprecated, we should get rid of it.
61RUN python3 -m pip install six==1.16.0
62
63# Google Cloud Platform API libraries
64# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
65RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
66
67
68# Install composer
69RUN curl -sS https://getcomposer.org/installer | php
70RUN mv composer.phar /usr/local/bin/composer
71
72#=================
73# Install cmake
74# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
75
76RUN apt-get update && apt-get install -y cmake && apt-get clean
77
78#=================
79# Install ccache
80
81# Install ccache from source since ccache 3.x packaged with most linux distributions
82# does not support Redis backend for caching.
83RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.7.5/ccache-4.7.5.tar.gz \
84    && tar -zxf ccache.tar.gz \
85    && cd ccache-4.7.5 \
86    && mkdir build && cd build \
87    && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
88    && make -j4 && make install \
89    && cd ../.. \
90    && rm -rf ccache-4.7.5 ccache.tar.gz
91
92
93RUN mkdir /var/local/jenkins
94
95# Required by XDS interop test harness.
96RUN python3 -m pip install virtualenv==16.7.9
97
98
99# Define the default command.
100CMD ["bash"]
101