xref: /aosp_15_r20/external/perfetto/infra/ui.perfetto.dev/builder/Dockerfile (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
1# Copyright (C) 2021 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# The image that builds the Perfetto UI and deploys to GCS.
16# See go/perfetto-ui-autopush for docs on how this works end-to-end.
17
18FROM debian:bookworm-slim
19
20ENV PATH=/builder/google-cloud-sdk/bin/:$PATH
21RUN set -ex; \
22    export DEBIAN_FRONTEND=noninteractive; \
23    apt-get update; \
24    apt-get -y install python3 python3-distutils python3-pip git curl tar tini \
25            pkg-config zip libc-dev python3-protobuf python3-crcmod; \
26    mkdir -p /builder && \
27    curl -s -o - https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz | tar -zx -C /builder; \
28    /builder/google-cloud-sdk/install.sh \
29        --usage-reporting=false \
30        --bash-completion=false \
31        --disable-installation-options \
32        --override-components gcloud gsutil; \
33    git config --system credential.helper gcloud.sh; \
34    useradd -d /home/perfetto perfetto; \
35    apt-get -y autoremove; \
36    rm -rf /var/lib/apt/lists/* /usr/share/man/* /usr/share/doc/*; \
37    rm -rf /builder/google-cloud-sdk/.install/.backup;
38
39ADD ui_builder_entrypoint.sh /ui_builder_entrypoint.sh
40RUN chmod 755 /ui_builder_entrypoint.sh
41
42ENTRYPOINT [ "tini", "-g", "--" ]
43