Created
October 18, 2016 17:32
-
-
Save rbsilva/fb2923f7efd4f52c199920d4c7e95d70 to your computer and use it in GitHub Desktop.
Android SDK Dockerfile
This file contains 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
FROM ubuntu:14.04 | |
MAINTAINER Rodrigo Silva "rbsilva.ti@gmail.com" | |
# Install java7 | |
RUN apt-get install -y software-properties-common && \ | |
add-apt-repository -y ppa:webupd8team/java && \ | |
dpkg --add-architecture i386 && \ | |
apt-get update && \ | |
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \ | |
apt-get install -y oracle-java7-installer && \ | |
apt-get install -y --force-yes expect git wget libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1 python curl && \ | |
apt-get install -q -y wget build-essential libx11-6:i386 && \ | |
apt-get clean && \ | |
rm -rf /var/lib/apt/lists/* | |
# Install Android SDK | |
RUN cd /opt && \ | |
wget --output-document=android-sdk.tgz --quiet http://dl.google.com/android/android-sdk_r24.1.2-linux.tgz && \ | |
tar xzf android-sdk.tgz && \ | |
rm -f android-sdk.tgz && \ | |
chown -R root.root android-sdk-linux | |
# Setup environment | |
ENV ANDROID_HOME /opt/android-sdk-linux | |
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools | |
# Install sdk elements | |
COPY tools /opt/tools | |
ENV PATH ${PATH}:/opt/tools | |
RUN ["/opt/tools/android-accept-licenses.sh", "android update sdk --all --no-ui --filter platform-tools,tools,build-tools-19.0.0,android-19,addon-google_apis_x86-google-19,extra-android-support,extra-android-m2repository,extra-google-m2repository,sys-img-armeabi-v7a-android-19"] | |
RUN which adb | |
RUN which android | |
# Create emulator | |
RUN echo "no" | android create avd \ | |
--force \ | |
--device "Nexus 5" \ | |
--target "android-19" \ | |
--name instagram \ | |
--abi armeabi-v7a \ | |
--skin 1080x1920 \ | |
--sdcard 512M | |
# GO to workspace | |
RUN mkdir -p /opt/workspace | |
WORKDIR /opt/workspace |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment