skia2/infra/skqp/docker/android-skqp/Dockerfile
Kevin Lubick 35b87a5b44 Add Build and Test jobs for SKQP using docker.
Uses Docker to compile an APK and then run it on an emulator.

We use a specialized image for build (includes Clang, etc)
And then the 3rd party base image for just the test (which
has the emulator and SDK on it).

Bug: skia:7578, skia:7692
Change-Id: I948e0b091868e7173b00e3affd7c3d59a5cd1ec2
Reviewed-on: https://skia-review.googlesource.com/c/159681
Reviewed-by: Stephan Altmueller <stephana@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2018-10-08 19:17:25 +00:00

40 lines
1.5 KiB
Docker

# This image can be used to build an Android app using the NDK, since $ANDROID_HOME is set.
# The only "Skia-specific" thing is the depot_tools, everything else is pretty generic.
#
# The base Docker image (butomo1989/docker-android-x86-8.1:1.4-p1) has an android emulator
# that can be run by doing the following
# docker run --privileged -d --name android_em -e DEVICE="Samsung Galaxy S6" butomo1989/docker-android-x86-8.1:1.4-p1
# Then, the running container can be attached to by:
# docker exec -it android_em /bin/bash
# Of course, this Docker image can also do that, it's just a bit heavier for "emulation only"
# tasks.
FROM butomo1989/docker-android-x86-8.1:1.4-p1
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y \
clang-6.0 \
git \
python
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /opt/depot_tools
WORKDIR /root
RUN wget -O /root/android-ndk-r18-linux-x86_64.zip https://storage.googleapis.com/skia-cdn/android-sdk/android-ndk-r18-linux-x86_64.zip && \
unzip /root/android-ndk-r18-linux-x86_64.zip && \
rm -f /root/android-ndk-r18-linux-x86_64.zip
RUN sdkmanager ndk-bundle "lldb;3.1" "cmake;3.6.4111459"
RUN update-alternatives --install /usr/bin/cc cc /usr/lib/llvm-6.0/bin/clang 20 && \
update-alternatives --install /usr/bin/c++ c++ /usr/lib/llvm-6.0/bin/clang++ 20
ENV CC="/usr/lib/llvm-6.0/bin/clang" \
CXX="/usr/lib/llvm-6.0/bin/clang++" \
PATH=/usr/lib/llvm-6.0/bin:$PATH
ENV PATH=$PATH:/opt/depot_tools
ENV ANDROID_NDK=/root/android-ndk-r18