1# Copyright (C) 2019 The Android Open Source Project 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# Creates an image that can check out / build / test the perfetto source. The 16# image is used by the Kokoro continuous integration jobs, but is also suitable 17# for local development. 18 19FROM debian:buster 20 21RUN set -ex; \ 22 export DEBIAN_FRONTEND=noninteractive; \ 23 echo deb http://deb.debian.org/debian buster-backports main > \ 24 /etc/apt/sources.list.d/backports.list; \ 25 apt-get update; \ 26 apt-get -y install python3 python3-pip git curl sudo lz4 tar ccache tini \ 27 libpulse0 libgl1 libxml2 libc6-dev-i386 libtinfo5 \ 28 gnupg2 pkg-config zip g++ zlib1g-dev unzip \ 29 python3-distutils clang-8 gcc-7 g++-7; \ 30 update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1; \ 31 gcc-7 --version; \ 32 g++-7 --version; \ 33 clang-8 --version; \ 34 clang++-8 --version; \ 35 pip3 install --quiet protobuf pandas; \ 36 groupadd -g 1337 perfetto; \ 37 useradd -d /ci/ramdisk -u 1337 -g perfetto perfetto; \ 38 apt-get -y autoremove; \ 39 rm -rf /var/lib/apt/lists/* /usr/share/man/* /usr/share/doc/*; 40 41RUN set -ex; \ 42 curl -LO https://github.com/bazelbuild/bazel/releases/download/2.2.0/bazel-2.2.0-installer-linux-x86_64.sh; \ 43 chmod +x bazel-*-installer-linux-x86_64.sh; \ 44 ./bazel-*-installer-linux-x86_64.sh; \ 45 rm bazel-*-installer-linux-x86_64.sh; \ 46 bazel version; 47 48COPY testrunner.sh /ci/testrunner.sh 49COPY init.sh /ci/init.sh 50RUN chmod -R a+rx /ci/ 51 52VOLUME [ "/ci/cache", "/ci/ramdisk", "/ci/artifacts" ] 53ENTRYPOINT [ "tini", "-g", "--" ] 54CMD [ "bash", "/ci/init.sh" ] 55 56