| %YAML 1.2 |
| --- | |
| # Copyright 2023 The gRPC Authors |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| FROM ubuntu:20.04 |
| |
| # Workaround the "tzdata hangs apt-get install during docker image build" issue for ubuntu20.04 |
| # by setting timezone to "Etc/UTC" in advance. |
| RUN echo "Etc/UTC" > /etc/timezone |
| |
| RUN apt-get update && apt-get install -y build-essential curl git time wget zip && apt-get clean |
| |
| <%include file="../../run_tests_python_deps.include"/> |
| |
| # Some bazel tests expect "python" binary to exist |
| RUN ln -s /usr/bin/python3 /usr/bin/python |
| |
| # Install Google's LLVM build for Ubuntu 20.04 |
| # Heavily inspired by https://github.com/GoogleCloudPlatform/container-definitions/tree/master/ubuntu1804_rbe |
| # See go/llvm-docker |
| # Note that we are using the google's pre-built tools for multiple reasons: |
| # * this is what the "official" rbe-ubuntu18-04 image is using: See https://github.com/GoogleCloudPlatform/layer-definitions/tree/master/layers/ubuntu1804/clang |
| # * for sanitizers to work, we need MSAN and TSAN enabled versions of libc++ |
| # Check https://storage.googleapis.com/clang-builds-stable/clang-ubuntu20_04/latest.txt |
| # for the value of LLVM_LATEST. |
| ARG LLVM_LATEST="3b5e7c83a6e226d5bd7ed2e9b67449b64812074c" |
| RUN wget -q https://storage.googleapis.com/clang-builds-stable/clang-ubuntu20_04/clang_r<%text>${LLVM_LATEST}</%text>.tar.gz -O /tmp/clang.tar.gz ${'\\'} |
| && tar -xzf /tmp/clang.tar.gz -C /usr/local && rm /tmp/clang.tar.gz |
| RUN wget -q https://storage.googleapis.com/clang-builds-stable/clang-ubuntu20_04/libcxx_r<%text>${LLVM_LATEST}</%text>.tar.gz -O /tmp/libcxx.tar.gz ${'\\'} |
| && tar -xzf /tmp/libcxx.tar.gz -C /usr/local && rm /tmp/libcxx.tar.gz |
| RUN wget -q https://storage.googleapis.com/clang-builds-stable/clang-ubuntu20_04/libcxx-msan_r<%text>${LLVM_LATEST}</%text>.tar.gz -O /tmp/libcxx-msan.tar.gz ${'\\'} |
| && mkdir -p /usr/local/libcxx-msan && tar -xzf /tmp/libcxx-msan.tar.gz -C /usr/local/libcxx-msan && rm /tmp/libcxx-msan.tar.gz |
| RUN wget -q https://storage.googleapis.com/clang-builds-stable/clang-ubuntu20_04/libcxx-tsan_r<%text>${LLVM_LATEST}</%text>.tar.gz -O /tmp/libcxx-tsan.tar.gz ${'\\'} |
| && mkdir -p /usr/local/libcxx-tsan && tar -xzf /tmp/libcxx-tsan.tar.gz -C /usr/local/libcxx-tsan && rm /tmp/libcxx-tsan.tar.gz |
| RUN wget -q https://storage.googleapis.com/clang-builds-stable/clang-ubuntu20_04/lld_r<%text>${LLVM_LATEST}</%text>.tar.gz -O /tmp/lld.tar.gz ${'\\'} |
| && tar -xzf /tmp/lld.tar.gz -C /usr/local && rm /tmp/lld.tar.gz |
| |
| ENV ASAN_SYMBOLIZER_PATH=/usr/local/bin/llvm-symbolizer |
| ENV CC=/usr/local/bin/clang |
| ENV GCOV=/dev/null |
| ENV LIBRARY_PATH=/usr/local/lib |
| ENV LD_LIBRARY_PATH=/usr/local/lib |
| ENV MSAN_SYMBOLIZER_PATH=/usr/local/bin/llvm-symbolizer |
| ENV TSAN_SYMBOLIZER_PATH=/usr/local/bin/llvm-symbolizer |
| ENV UBSAN_SYMBOLIZER_PATH=/usr/local/bin/llvm-symbolizer |
| |
| # TODO(jtattermusch): Remove python2 once some tests stop failing without it. |
| RUN apt-get update && apt-get install -y python2 && apt-get clean |
| |
| # Define the default command. |
| CMD ["bash"] |