xref: /aosp_15_r20/external/google-cloud-java/owl-bot-postprocessor/Dockerfile (revision 55e87721aa1bc457b326496a7ca40f3ea1a63287)
1*55e87721SMatt Gilbride# Copyright 2022 Google LLC
2*55e87721SMatt Gilbride#
3*55e87721SMatt Gilbride# Licensed under the Apache License, Version 2.0 (the "License");
4*55e87721SMatt Gilbride# you may not use this file except in compliance with the License.
5*55e87721SMatt Gilbride# You may obtain a copy of the License at
6*55e87721SMatt Gilbride#
7*55e87721SMatt Gilbride#     http://www.apache.org/licenses/LICENSE-2.0
8*55e87721SMatt Gilbride#
9*55e87721SMatt Gilbride# Unless required by applicable law or agreed to in writing, software
10*55e87721SMatt Gilbride# distributed under the License is distributed on an "AS IS" BASIS,
11*55e87721SMatt Gilbride# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*55e87721SMatt Gilbride# See the License for the specific language governing permissions and
13*55e87721SMatt Gilbride# limitations under the License.
14*55e87721SMatt Gilbride
15*55e87721SMatt Gilbride# Specifying our own image is more reliable than 3rd-party image, which
16*55e87721SMatt Gilbride# may become unavailable due to their maintenance policy.
17*55e87721SMatt GilbrideFROM gcr.io/cloud-devrel-public-resources/java17
18*55e87721SMatt Gilbride
19*55e87721SMatt GilbrideRUN apt-get update && \
20*55e87721SMatt Gilbride    apt-get -y upgrade && \
21*55e87721SMatt Gilbride    apt-get install wget && \
22*55e87721SMatt Gilbride    apt-get install unzip && \
23*55e87721SMatt Gilbride    apt -y install git && \
24*55e87721SMatt Gilbride    apt-get install -y --no-install-recommends libxml2-utils apt-transport-https ca-certificates gnupg && \
25*55e87721SMatt Gilbride    rm -rf /var/cache/apt
26*55e87721SMatt Gilbride
27*55e87721SMatt Gilbride# Install python. Pyenv is installed in gcr.io/cloud-devrel-public-resources/java17 already
28*55e87721SMatt GilbrideRUN pyenv install 3.10.8 && \
29*55e87721SMatt Gilbride    pyenv global 3.10.8 && \
30*55e87721SMatt Gilbride    python3 -m pip install --upgrade pip setuptools
31*55e87721SMatt Gilbride
32*55e87721SMatt Gilbride# Install docker
33*55e87721SMatt GilbrideRUN apt-get update && apt-get install -y \
34*55e87721SMatt Gilbride        apt-transport-https \
35*55e87721SMatt Gilbride        ca-certificates \
36*55e87721SMatt Gilbride        curl \
37*55e87721SMatt Gilbride        gnupg-agent \
38*55e87721SMatt Gilbride        lsb-release \
39*55e87721SMatt Gilbride        software-properties-common && \
40*55e87721SMatt Gilbride    curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - && \
41*55e87721SMatt Gilbride    add-apt-repository \
42*55e87721SMatt Gilbride        "deb [arch=amd64] https://download.docker.com/linux/debian \
43*55e87721SMatt Gilbride        bullseye \
44*55e87721SMatt Gilbride        stable" && \
45*55e87721SMatt Gilbride    apt-get update && \
46*55e87721SMatt Gilbride    apt-get install -y docker-ce docker-ce-cli containerd.io
47*55e87721SMatt Gilbride
48*55e87721SMatt Gilbride# Install jq
49*55e87721SMatt GilbrideRUN apt-get -y install jq
50*55e87721SMatt Gilbride
51*55e87721SMatt Gilbride# Owl Bot service brings the branch of the repository copy to /workspace
52*55e87721SMatt GilbrideWORKDIR /workspace
53*55e87721SMatt Gilbride
54*55e87721SMatt Gilbride# Build context is owl-bot-postprocessor
55*55e87721SMatt GilbrideCOPY requirements.txt /synthtool/requirements.txt
56*55e87721SMatt Gilbride
57*55e87721SMatt GilbrideRUN python3 -m pip install --require-hashes -r /synthtool/requirements.txt
58*55e87721SMatt Gilbride
59*55e87721SMatt GilbrideCMD [ "owl-bot-postprocessor/main.sh" ]
60