• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 silkeh/clang:15-bullseye
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# Install Python 3.7 from source (and installed as a default python3)
58# (Bullseye comes with Python 3.9 which isn't supported by pytype yet)
59RUN apt update && apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev \
60                            libnss3-dev libssl-dev libreadline-dev libffi-dev libbz2-dev
61RUN curl -O https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tar.xz && \
62tar -xf Python-3.7.9.tar.xz && \
63cd Python-3.7.9 && \
64./configure && \
65make -j 4 && \
66make install
67RUN curl https://bootstrap.pypa.io/get-pip.py | python3
68
69# Google Cloud Platform API libraries
70# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
71RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
72
73
74RUN mkdir /var/local/jenkins
75
76
77#========================
78# Sanity test dependencies
79
80RUN apt-get update && apt-get install -y \
81      autoconf \
82      automake \
83      libtool \
84      curl \
85      shellcheck
86
87# otherwise clang-tidy will report missing <gtest/gtest.h> header
88RUN apt-get update && apt-get install -y libgtest-dev && apt-get clean
89
90RUN python3 -m pip install simplejson mako virtualenv==16.7.9 lxml six
91
92# Upgrade Python's YAML library
93RUN python3 -m pip install --upgrade --ignore-installed PyYAML==5.4.1 --user
94
95# Install prerequisites for the clang-tidy script
96RUN apt-get update && apt-get install -y jq git
97
98# Install prerequisites for the iwyu script
99RUN apt-get update && apt-get install -y jq git cmake zlib1g-dev libtinfo-dev libclang-15-dev && apt-get clean
100
101#========================
102# Bazel installation
103
104# Must be in sync with tools/bazel
105ENV BAZEL_VERSION 6.1.2
106
107# The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper.
108ENV DISABLE_BAZEL_WRAPPER 1
109
110# Download the correct bazel version and make sure it's on path.
111RUN BAZEL_ARCH_SUFFIX="$(uname -m | sed s/aarch64/arm64/)" \
112  && curl -sSL --fail -o /usr/local/bin/bazel "https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-linux-$BAZEL_ARCH_SUFFIX" \
113  && chmod a+x /usr/local/bin/bazel
114
115# Normally we would run "bazel --version" here to make sure bazel
116# was correctly installed, but we can't do that because
117# of # https://github.com/bazelbuild/bazel/issues/11379.
118# We want to keep the arm64 version of the image buildable
119# on x64 with use of qemu-user-static & binfmt emulation,
120# but the self-extraction is broken for bazel currently.
121# The binary will work correctly when run on real arm64
122# hardware, when qemu-user-static isn't getting into the way.
123
124# Install buildifier v0.29.0
125RUN wget https://github.com/bazelbuild/buildtools/releases/download/0.29.0/buildifier
126RUN chmod +x buildifier
127RUN mv buildifier /usr/local/bin
128
129#=================
130# Setup git to access working directory across docker boundary
131
132RUN git config --global --add safe.directory /var/local/jenkins/grpc
133RUN git config --global protocol.file.allow always
134
135
136# Define the default command.
137CMD ["bash"]
138