| 1 |
# Copyright 2021 The 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 |
FROM debian:stretch |
| 16 |
|
| 17 |
#================= |
| 18 |
# Basic C core dependencies |
| 19 |
|
| 20 |
# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md |
| 21 |
RUN apt-get update && apt-get install -y \ |
| 22 |
build-essential \ |
| 23 |
autoconf \ |
| 24 |
libtool \ |
| 25 |
pkg-config \ |
| 26 |
&& apt-get clean |
| 27 |
|
| 28 |
# GCC |
| 29 |
RUN apt-get update && apt-get install -y \ |
| 30 |
gcc \ |
| 31 |
g++ \ |
| 32 |
&& apt-get clean |
| 33 |
|
| 34 |
# libc6 |
| 35 |
RUN apt-get update && apt-get install -y \ |
| 36 |
libc6 \ |
| 37 |
libc6-dbg \ |
| 38 |
libc6-dev \ |
| 39 |
&& apt-get clean |
| 40 |
|
| 41 |
# Tools |
| 42 |
RUN 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 |
# run_tests.py python dependencies |
| 58 |
|
| 59 |
# Basic python dependencies to be able to run tools/run_tests python scripts |
| 60 |
# These dependencies are not sufficient to build gRPC Python, gRPC Python |
| 61 |
# deps are defined elsewhere (e.g. python_deps.include) |
| 62 |
RUN apt-get update && apt-get install -y \ |
| 63 |
python3 \ |
| 64 |
python3-pip \ |
| 65 |
python3-setuptools \ |
| 66 |
python3-yaml \ |
| 67 |
&& apt-get clean |
| 68 |
|
| 69 |
# use pinned version of pip to avoid sudden breakages |
| 70 |
RUN python3 -m pip install --upgrade pip==19.3.1 |
| 71 |
|
| 72 |
# TODO(jtattermusch): currently six is needed for tools/run_tests scripts |
| 73 |
# but since our python2 usage is deprecated, we should get rid of it. |
| 74 |
RUN python3 -m pip install six==1.16.0 |
| 75 |
|
| 76 |
# Google Cloud Platform API libraries |
| 77 |
# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) |
| 78 |
RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 |
| 79 |
|
| 80 |
|
| 81 |
#================= |
| 82 |
# Install cmake |
| 83 |
# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement. |
| 84 |
|
| 85 |
RUN apt-get update && apt-get install -y cmake && apt-get clean |
| 86 |
|
| 87 |
|
| 88 |
RUN mkdir /var/local/jenkins |
| 89 |
|
| 90 |
|
| 91 |
# Java required by Android SDK |
| 92 |
RUN apt-get update && apt-get -y install openjdk-8-jdk && apt-get clean |
| 93 |
|
| 94 |
# Install Android SDK |
| 95 |
ENV ANDROID_SDK_VERSION 4333796 |
| 96 |
RUN mkdir -p /opt/android-sdk && cd /opt/android-sdk && \ |
| 97 |
wget -q https://dl.google.com/android/repository/sdk-tools-linux-$ANDROID_SDK_VERSION.zip && \ |
| 98 |
unzip -q sdk-tools-linux-$ANDROID_SDK_VERSION.zip && \ |
| 99 |
rm sdk-tools-linux-$ANDROID_SDK_VERSION.zip |
| 100 |
ENV ANDROID_SDK_PATH /opt/android-sdk |
| 101 |
ENV ANDROID_HOME /opt/android-sdk |
| 102 |
RUN yes | $ANDROID_SDK_PATH/tools/bin/sdkmanager --licenses # accept all licenses |
| 103 |
|
| 104 |
# Install ndk-bundle and cmake using sdkmanager |
| 105 |
RUN mkdir -p ~/.android && touch ~/.android/repositories.cfg |
| 106 |
RUN $ANDROID_SDK_PATH/tools/bin/sdkmanager ndk-bundle 'cmake;3.6.4111459' |
| 107 |
|
| 108 |
# Install Android NDK |
| 109 |
RUN curl -L -o android-ndk.zip http://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip && \ |
| 110 |
unzip -q android-ndk.zip -d /opt && \ |
| 111 |
rm -f android-ndk.zip |
| 112 |
ENV ANDROID_NDK_PATH /opt/android-ndk-r16b |
| 113 |
ENV ANDROID_NDK_HOME /opt/android-ndk-r16b |
| 114 |
|
| 115 |
# Install gcloud |
| 116 |
RUN curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-407.0.0-linux-x86_64.tar.gz && \ |
| 117 |
tar -xf google-cloud-cli-407.0.0-linux-x86_64.tar.gz && \ |
| 118 |
./google-cloud-sdk/install.sh --bash-completion=false --path-update=true && \ |
| 119 |
rm -rf google-cloud-cli-407.0.0-linux-x86_64.tar.gz |
| 120 |
RUN ln -s /google-cloud-sdk/bin/gcloud /usr/local/bin/gcloud |
| 121 |
|
| 122 |
# Define the default command. |
| 123 |
CMD ["bash"] |