Dockerfile.template 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. %YAML 1.2
  2. --- |
  3. # Copyright 2021 The gRPC Authors
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. FROM debian:stretch
  17. <%include file="../apt_get_basic.include"/>
  18. <%include file="../run_tests_python_deps.include"/>
  19. <%include file="../cmake.include"/>
  20. <%include file="../run_tests_addons.include"/>
  21. # Java required by Android SDK
  22. RUN apt-get update && apt-get -y install openjdk-8-jdk && apt-get clean
  23. # Install Android SDK
  24. ENV ANDROID_SDK_VERSION 4333796
  25. RUN mkdir -p /opt/android-sdk && cd /opt/android-sdk && \
  26. wget -q https://dl.google.com/android/repository/sdk-tools-linux-$ANDROID_SDK_VERSION.zip && \
  27. unzip -q sdk-tools-linux-$ANDROID_SDK_VERSION.zip && \
  28. rm sdk-tools-linux-$ANDROID_SDK_VERSION.zip
  29. ENV ANDROID_SDK_PATH /opt/android-sdk
  30. # Install Android NDK and cmake using sdkmanager
  31. RUN mkdir -p ~/.android && touch ~/.android/repositories.cfg
  32. RUN yes | $ANDROID_SDK_PATH/tools/bin/sdkmanager --licenses # accept all licenses
  33. RUN $ANDROID_SDK_PATH/tools/bin/sdkmanager ndk-bundle 'cmake;3.6.4111459'
  34. ENV ANDROID_NDK_PATH $ANDROID_SDK_PATH/ndk-bundle
  35. ENV ANDROID_SDK_CMAKE $ANDROID_SDK_PATH/cmake/3.6.4111459/bin/cmake
  36. # Define the default command.
  37. CMD ["bash"]