xref: /aosp_15_r20/external/grpc-grpc/tools/dockerfile/test/cxx_alpine_x64/Dockerfile (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
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 alpine:3.15
16
17# Install Git and basic packages.
18RUN apk update && apk add \
19  autoconf \
20  automake \
21  bzip2 \
22  build-base \
23  cmake \
24  curl \
25  gcc \
26  git \
27  libtool \
28  linux-headers \
29  make \
30  perl \
31  strace \
32  python3 \
33  py3-pip \
34  unzip \
35  wget \
36  zip
37
38#=================
39# Setup git to access working directory across docker boundary.
40# This avoids the "fatal: detected dubious ownership in repository XYZ"
41# git error.
42
43RUN git config --global --add safe.directory '*'
44RUN git config --global protocol.file.allow always
45
46
47# use pinned version of pip to avoid sudden breakages
48RUN python3 -m pip install --upgrade pip==19.3.1
49
50# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
51# but since our python2 usage is deprecated, we should get rid of it.
52RUN python3 -m pip install six==1.16.0
53
54# Google Cloud Platform API libraries
55# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
56RUN python3 -m pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
57
58RUN python3 -m pip install --upgrade --ignore-installed PyYAML==6.0.1 --user
59
60# Some cxx tests depend on the twisted package
61RUN python3 -m pip install twisted
62
63#=================
64# Install ccache
65
66# Install ccache from source since ccache 3.x packaged with most linux distributions
67# does not support Redis backend for caching.
68RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.7.5/ccache-4.7.5.tar.gz \
69    && tar -zxf ccache.tar.gz \
70    && cd ccache-4.7.5 \
71    && mkdir build && cd build \
72    && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
73    && make -j4 && make install \
74    && cd ../.. \
75    && rm -rf ccache-4.7.5 ccache.tar.gz
76
77
78RUN mkdir /var/local/jenkins
79
80
81
82# Define the default command.
83CMD ["bash"]
84