Debian Codegraph @

tools/dockerfile/test/bazel/Dockerfile

raw
1 # Copyright 2015 gRPC authors.
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 # Pinned version of the base image is used to avoid regressions caused
16 # by rebuilding of this docker image. To see available versions, you can run
17 # "gcloud container images list-tags gcr.io/oss-fuzz-base/base-builder"
18 # Image(8a3a7b8072a9) is built on Sep 5, 2022
19 FROM gcr.io/oss-fuzz-base/base-builder@sha256:8a3a7b8072a93ba737b02e0c0941903f5408b4def6333fdc823b77aede5b2afd
20
21 # -------------------------- WARNING --------------------------------------
22 # If you are making changes to this file, consider changing
23 # https://github.com/google/oss-fuzz/blob/master/projects/grpc/Dockerfile
24 # accordingly.
25 # -------------------------------------------------------------------------
26
27 # Install basic packages
28 RUN apt-get update && apt-get -y install \
29 autoconf \
30 build-essential \
31 curl \
32 libtool \
33 make \
34 vim \
35 wget
36
37 #========================
38 # Bazel installation
39
40 # Must be in sync with tools/bazel
41 ENV BAZEL_VERSION 5.3.0
42
43 # The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper.
44 ENV DISABLE_BAZEL_WRAPPER 1
45
46 # Download the correct bazel version and make sure it's on path.
47 RUN BAZEL_ARCH_SUFFIX="$(uname -m | sed s/aarch64/arm64/)" \
48 && curl -sSL --fail -o /usr/local/bin/bazel "https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-linux-$BAZEL_ARCH_SUFFIX" \
49 && chmod a+x /usr/local/bin/bazel
50
51 # Normally we would run "bazel --version" here to make sure bazel
52 # was correctly installed, but we can't do that because
53 # of # https://github.com/bazelbuild/bazel/issues/11379.
54 # We want to keep the arm64 version of the image buildable
55 # on x64 with use of qemu-user-static & binfmt emulation,
56 # but the self-extraction is broken for bazel currently.
57 # The binary will work correctly when run on real arm64
58 # hardware, when qemu-user-static isn't getting into the way.
59
60
61 RUN mkdir -p /var/local/jenkins
62
63 RUN git config --global --add safe.directory /var/local/jenkins/grpc
64
65 # Define the default command.
66 CMD ["bash"]