Dockerfile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # Copyright 2021 The 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. # Pinned version of the base image is used to avoid regressions caused
  15. # by rebuilding of this docker image. To see available versions, you can run
  16. # "gcloud container images list-tags gcr.io/oss-fuzz-base/base-builder"
  17. # Image(5eceb81f5759) is built on Jan 31, 2022
  18. FROM gcr.io/oss-fuzz-base/base-builder@sha256:5eceb81f57599d63ca7c9a70c8968b23b128119699626ca749017019eb0b523f
  19. # -------------------------- WARNING --------------------------------------
  20. # If you are making changes to this file, consider changing
  21. # https://github.com/google/oss-fuzz/blob/master/projects/grpc/Dockerfile
  22. # accordingly.
  23. # -------------------------------------------------------------------------
  24. # Install basic packages
  25. RUN apt-get update && apt-get -y install \
  26. autoconf \
  27. build-essential \
  28. curl \
  29. libtool \
  30. make \
  31. vim \
  32. wget
  33. #========================
  34. # Bazel installation
  35. # Must be in sync with tools/bazel
  36. ENV BAZEL_VERSION 4.2.1
  37. # The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper.
  38. ENV DISABLE_BAZEL_WRAPPER 1
  39. RUN apt-get update && apt-get install -y wget && apt-get clean
  40. RUN wget "https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh" && \
  41. bash ./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \
  42. rm bazel-$BAZEL_VERSION-installer-linux-x86_64.sh
  43. #========================
  44. # Java
  45. RUN apt-get install -y openjdk-8-jdk
  46. #========================
  47. # Android SDK/NDK installation
  48. ENV SDK_ROOT=/opt/android-sdk
  49. RUN mkdir -p $SDK_ROOT
  50. RUN wget -O cmd.zip dl.google.com/android/repository/commandlinetools-linux-7302050_latest.zip && unzip cmd.zip && rm cmd.zip && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'tools' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'platform-tools' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'build-tools;30.0.3' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'platforms;android-29' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'ndk-bundle' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'ndk;21.4.7075529'
  51. # Set environment variables for Bazel rules
  52. ENV ANDROID_HOME=/opt/android-sdk
  53. ENV ANDROID_NDK_HOME=/opt/android-sdk/ndk/21.4.7075529
  54. RUN mkdir -p /var/local/jenkins
  55. # Define the default command.
  56. CMD ["bash"]