1# Copyright 2021 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 silkeh/clang:7-buster 16 17RUN apt update && apt -y upgrade && apt install -y build-essential curl git time wget zip && apt clean 18#================= 19# Setup git to access working directory across docker boundary. 20# This avoids the "fatal: detected dubious ownership in repository XYZ" 21# git error. 22 23RUN git config --global --add safe.directory '*' 24RUN git config --global protocol.file.allow always 25 26#==================== 27# run_tests.py python dependencies 28 29# Basic python dependencies to be able to run tools/run_tests python scripts 30# These dependencies are not sufficient to build gRPC Python, gRPC Python 31# deps are defined elsewhere (e.g. python_deps.include) 32RUN apt-get update && apt-get install -y \ 33 python3 \ 34 python3-pip \ 35 python3-setuptools \ 36 python3-yaml \ 37 && apt-get clean 38 39# use pinned version of pip to avoid sudden breakages 40RUN python3 -m pip install --upgrade pip==19.3.1 41 42# TODO(jtattermusch): currently six is needed for tools/run_tests scripts 43# but since our python2 usage is deprecated, we should get rid of it. 44RUN python3 -m pip install six==1.16.0 45 46# Google Cloud Platform API libraries 47# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) 48RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 49 50 51# Some cxx tests depend on the twisted package 52RUN python3 -m pip install twisted 53 54#================= 55# C++ dependencies 56RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean 57 58#================= 59# Install cmake using the install script. 60RUN curl -sSL -o cmake-linux.sh https://github.com/Kitware/CMake/releases/download/v3.16.1/cmake-3.16.1-Linux-x86_64.sh \ 61 && sh cmake-linux.sh -- --skip-license --prefix=/usr \ 62 && rm cmake-linux.sh 63 64#================= 65# Install ccache 66 67# Install ccache from source since ccache 3.x packaged with most linux distributions 68# does not support Redis backend for caching. 69RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.7.5/ccache-4.7.5.tar.gz \ 70 && tar -zxf ccache.tar.gz \ 71 && cd ccache-4.7.5 \ 72 && mkdir build && cd build \ 73 && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \ 74 && make -j4 && make install \ 75 && cd ../.. \ 76 && rm -rf ccache-4.7.5 ccache.tar.gz 77 78 79RUN mkdir /var/local/jenkins 80 81 82# Define the default command. 83CMD ["bash"] 84