xref: /aosp_15_r20/external/grpc-grpc/tools/dockerfile/test/python_alpine_x64/Dockerfile (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1# Copyright 2018 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
15FROM alpine:3.15
16
17# Install Git and basic packages.
18RUN apk update && apk add   autoconf   automake   bzip2   build-base   cmake   ccache   curl   gcc   git   libtool   linux-headers   make   perl   strace   python3-dev   py3-pip   unzip   wget   zip
19
20#=================
21# Setup git to access working directory across docker boundary.
22# This avoids the "fatal: detected dubious ownership in repository XYZ"
23# git error.
24
25RUN git config --global --add safe.directory '*'
26RUN git config --global protocol.file.allow always
27
28
29RUN ln -s /usr/bin/python3 /usr/bin/python
30
31# Install Python packages from PyPI
32RUN python3 -m pip install --upgrade pip==19.3.1
33
34# Google Cloud Platform API libraries
35# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
36RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
37
38#=================
39# Install ccache
40
41# Install ccache from source since ccache 3.x packaged with most linux distributions
42# does not support Redis backend for caching.
43RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.7.5/ccache-4.7.5.tar.gz \
44    && tar -zxf ccache.tar.gz \
45    && cd ccache-4.7.5 \
46    && mkdir build && cd build \
47    && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
48    && make -j4 && make install \
49    && cd ../.. \
50    && rm -rf ccache-4.7.5 ccache.tar.gz
51
52
53RUN mkdir /var/local/jenkins
54
55