6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-11-16 10:05:18 +00:00
tutor/build/android/Dockerfile
Régis Behmo fab03b1a7b Fix android image building
For some reason, the license was not accepted anymore. Fixed by
following the recommended solution in:
https://github.com/travis-ci/travis-ci/issues/8874
2019-01-19 19:27:21 +01:00

38 lines
1.2 KiB
Docker

FROM ubuntu:18.04
RUN apt update && \
apt upgrade -y && \
apt install -y wget unzip git openjdk-8-jre openjdk-8-jdk
RUN mkdir /openedx
# Install Android SDK
# Inspired from https://github.com/LiveXP/docker-android-sdk/blob/master/Dockerfile
ENV ANDROID_SDK_VERSION 4333796
ENV ANDROID_SDK_PATH /openedx/android-sdk
ENV ANDROID_HOME /openedx/android-sdk
RUN mkdir /openedx/android-sdk
WORKDIR /openedx/android-sdk
RUN wget https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_VERSION}.zip && \
unzip sdk-tools-linux-${ANDROID_SDK_VERSION}.zip && \
rm sdk-tools-linux-${ANDROID_SDK_VERSION}.zip
# Accept licenses
RUN yes | /openedx/android-sdk/tools/bin/sdkmanager "platforms;android-27"
# Install android app repo
RUN git clone https://github.com/edx/edx-app-android /openedx/edx-app-android
WORKDIR /openedx/edx-app-android
# Install gradle and all dependencies
RUN ./gradlew -v
RUN ./gradlew tasks
# User-customized config
COPY ./edx.properties ./OpenEdXMobile/edx.properties
RUN mkdir /openedx/config
RUN ln -s /openedx/config/gradle.properties ./OpenEdXMobile/gradle.properties
CMD ./gradlew assembleProdDebuggable && \
cp OpenEdXMobile/build/outputs/apk/prod/debuggable/*.apk /openedx/data/