xref: /aosp_15_r20/external/google-cloud-java/owl-bot-postprocessor/Dockerfile (revision 55e87721aa1bc457b326496a7ca40f3ea1a63287)
1# Copyright 2022 Google LLC
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# Specifying our own image is more reliable than 3rd-party image, which
16# may become unavailable due to their maintenance policy.
17FROM gcr.io/cloud-devrel-public-resources/java17
18
19RUN apt-get update && \
20    apt-get -y upgrade && \
21    apt-get install wget && \
22    apt-get install unzip && \
23    apt -y install git && \
24    apt-get install -y --no-install-recommends libxml2-utils apt-transport-https ca-certificates gnupg && \
25    rm -rf /var/cache/apt
26
27# Install python. Pyenv is installed in gcr.io/cloud-devrel-public-resources/java17 already
28RUN pyenv install 3.10.8 && \
29    pyenv global 3.10.8 && \
30    python3 -m pip install --upgrade pip setuptools
31
32# Install docker
33RUN apt-get update && apt-get install -y \
34        apt-transport-https \
35        ca-certificates \
36        curl \
37        gnupg-agent \
38        lsb-release \
39        software-properties-common && \
40    curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - && \
41    add-apt-repository \
42        "deb [arch=amd64] https://download.docker.com/linux/debian \
43        bullseye \
44        stable" && \
45    apt-get update && \
46    apt-get install -y docker-ce docker-ce-cli containerd.io
47
48# Install jq
49RUN apt-get -y install jq
50
51# Owl Bot service brings the branch of the repository copy to /workspace
52WORKDIR /workspace
53
54# Build context is owl-bot-postprocessor
55COPY requirements.txt /synthtool/requirements.txt
56
57RUN python3 -m pip install --require-hashes -r /synthtool/requirements.txt
58
59CMD [ "owl-bot-postprocessor/main.sh" ]
60