1# Copyright 2015 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:bullseye 16 17# Install Git and basic packages. 18RUN apt-get update && apt-get install -y \ 19 autoconf \ 20 autotools-dev \ 21 build-essential \ 22 bzip2 \ 23 ccache \ 24 curl \ 25 dnsutils \ 26 gcc \ 27 gcc-multilib \ 28 git \ 29 golang \ 30 gyp \ 31 lcov \ 32 libc6 \ 33 libc6-dbg \ 34 libc6-dev \ 35 libgtest-dev \ 36 libtool \ 37 make \ 38 perl \ 39 strace \ 40 telnet \ 41 unzip \ 42 wget \ 43 zip && apt-get clean 44 45#================ 46# Build profiling 47RUN apt-get update && apt-get install -y time && apt-get clean 48 49# Install Python 3.7 from source (and installed as a default python3) 50# (Bullseye comes with Python 3.9 which isn't supported by pytype yet) 51RUN apt update && apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev \ 52 libnss3-dev libssl-dev libreadline-dev libffi-dev 53RUN curl -O https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tar.xz && \ 54 tar -xf Python-3.7.9.tar.xz && \ 55 cd Python-3.7.9 && \ 56 ./configure && \ 57 make -j 4 && \ 58 make install 59RUN curl https://bootstrap.pypa.io/get-pip.py | python3 60 61# Install Python 2.7 62RUN apt-get update && apt-get install -y python2 python2-dev 63RUN ln -s /usr/bin/python2 /usr/bin/python 64RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2 65 66# Google Cloud platform API libraries 67RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 68 69 70RUN mkdir /var/local/jenkins 71 72 73#================= 74# C++ dependencies 75RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean 76 77 78#======================== 79# Sanity test dependencies 80 81RUN apt-get update && apt-get install -y \ 82 autoconf \ 83 automake \ 84 libtool \ 85 curl \ 86 shellcheck 87RUN python2 -m pip install simplejson mako virtualenv==16.7.9 lxml 88RUN python3 -m pip install simplejson mako virtualenv==16.7.9 lxml six 89 90# Upgrade Python's YAML library 91RUN python2 -m pip install --upgrade --ignore-installed PyYAML==5.4.1 --user 92RUN python3 -m pip install --upgrade --ignore-installed PyYAML==5.4.1 --user 93 94# Install clang, clang-format, and clang-tidy 95RUN apt-get update && apt-get install -y clang clang-format-11 clang-tidy-11 jq 96ENV CLANG_FORMAT=clang-format-11 97ENV CLANG_TIDY=clang-tidy-11 98 99 100#======================== 101# Bazel installation 102 103# Must be in sync with tools/bazel 104ENV BAZEL_VERSION 3.7.1 105 106# The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper. 107ENV DISABLE_BAZEL_WRAPPER 1 108 109RUN apt-get update && apt-get install -y wget && apt-get clean 110RUN wget "https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh" && \ 111 bash ./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ 112 rm bazel-$BAZEL_VERSION-installer-linux-x86_64.sh 113 114# Install buildifier v0.29.0 115RUN wget https://github.com/bazelbuild/buildtools/releases/download/0.29.0/buildifier 116RUN chmod +x buildifier 117RUN mv buildifier /usr/local/bin 118 119 120# Define the default command. 121CMD ["bash"] 122