xref: /aosp_15_r20/external/grpc-grpc/tools/dockerfile/test/php7_debian11_x64/Dockerfile (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
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
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#====================
66# run_tests.py python dependencies
67
68# Basic python dependencies to be able to run tools/run_tests python scripts
69# These dependencies are not sufficient to build gRPC Python, gRPC Python
70# deps are defined elsewhere (e.g. python_deps.include)
71RUN apt-get update && apt-get install -y \
72  python3 \
73  python3-pip \
74  python3-setuptools \
75  python3-yaml \
76  && apt-get clean
77
78# use pinned version of pip to avoid sudden breakages
79RUN python3 -m pip install --upgrade pip==19.3.1
80
81# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
82# but since our python2 usage is deprecated, we should get rid of it.
83RUN python3 -m pip install six==1.16.0
84
85# Google Cloud Platform API libraries
86# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
87RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
88
89
90#=================
91# PHP7 dependencies
92
93# PHP specific dependencies
94RUN apt-get update && apt-get install -y \
95  libbison-dev \
96  libcurl4-openssl-dev \
97  libgmp-dev \
98  libgmp3-dev \
99  libssl-dev \
100  libxml2-dev \
101  re2c \
102  zlib1g-dev \
103  && apt-get clean
104
105# Compile PHP7 from source
106RUN git clone https://github.com/php/php-src /var/local/git/php-src
107RUN cd /var/local/git/php-src \
108  && git checkout PHP-7.2.34 \
109  && ./buildconf --force \
110  && ./configure \
111  --with-gmp \
112  --with-openssl \
113  --with-zlib \
114  && make -j$(nproc) \
115  && make install
116
117#=================
118# PHP Test dependencies
119
120 RUN apt-get update && apt-get install -y \
121    valgrind
122#=================
123# Install cmake
124# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
125
126RUN apt-get update && apt-get install -y cmake && apt-get clean
127
128#=================
129# Install ccache
130
131# Install ccache from source since ccache 3.x packaged with most linux distributions
132# does not support Redis backend for caching.
133RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.7.5/ccache-4.7.5.tar.gz \
134    && tar -zxf ccache.tar.gz \
135    && cd ccache-4.7.5 \
136    && mkdir build && cd build \
137    && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
138    && make -j4 && make install \
139    && cd ../.. \
140    && rm -rf ccache-4.7.5 ccache.tar.gz
141
142
143RUN mkdir /var/local/jenkins
144
145# Define the default command.
146CMD ["bash"]
147