Last active
March 7, 2017 06:07
-
-
Save rakshakhegde/0d070288e892833241b482be060c46a5 to your computer and use it in GitHub Desktop.
Docker cmds for Android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Building Android project from Command Line from barebones Docker Ubuntu | |
# | |
FROM ubuntu:latest | |
MAINTAINER Rakshak Hegde "[email protected]" | |
RUN apt-get update | |
# | |
# Setup Android SDK | |
# | |
ENV ANDROID_HOME /usr/local/android-sdk | |
ENV ANDROID_TOOLS_URL https://dl.google.com/android/repository/tools_r25.2.5-linux.zip | |
ENV ANDROID_TOOLS_NAME tools_r25.2.3-linux.zip | |
RUN mkdir $ANDROID_HOME | |
ENV ANDROID_TOOLS_FILEPATH $ANDROID_HOME/$ANDROID_TOOLS_NAME | |
RUN echo Y | apt-get install wget | |
RUN wget -O $ANDROID_TOOLS_FILEPATH $ANDROID_TOOLS_URL | |
RUN apt-get install unzip | |
RUN unzip $ANDROID_TOOLS_FILEPATH -d $ANDROID_HOME | |
RUN rm $ANDROID_TOOLS_FILEPATH | |
ADD ./sdk-packagefile ./ | |
RUN echo Y | apt-get install default-jdk | |
RUN echo Y | $ANDROID_HOME/tools/bin/sdkmanager --package_file=/sdk-packagefile | |
# | |
# Clone repo and build it | |
# | |
# User defined env vars | |
ENV WORKSPACE_ROOT /home/ | |
ENV PROJECT_NAME LastPagerAdapter | |
ENV PROJECT_URL https://github.com/rakshakhegde/LastPagerAdapter | |
ENV PROJECT_ROOT $WORKSPACE_ROOT/$PROJECT_NAME | |
RUN mkdir -p $WORKSPACE_ROOT | |
RUN echo Y | apt-get install git-core | |
RUN git clone $PROJECT_URL $PROJECT_ROOT | |
RUN $PROJECT_ROOT/gradlew | |
RUN $PROJECT_ROOT/gradlew build | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker build -t "android-ci" . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
build-tools;25.0.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment