Public Repository

Last pushed: 3 years ago
Short Description
Android development environment with JDK and NDK
Full Description

FROM ubuntu

MAINTAINER Heechul Ryu ""

Install jdk7 and other tools

RUN apt-get update
RUN apt-get install expect wget lib32z1 lib32stdc++6 openjdk-7-jdk ant -y

Install apktool2

RUN wget -O /usr/local/bin/apktool
RUN wget -O /usr/local/bin/apktool.jar
RUN chmod +x /usr/local/bin/apktool /usr/local/bin/apktool.jar

Install ndk

RUN wget -O /usr/src/android-ndk.bin
RUN chmod a+x /usr/src/android-ndk.bin
RUN cd /usr/src/
RUN /usr/src/android-ndk.bin
RUN cd /
RUN ln -s /usr/src/android-ndk-r10e /usr/src/android-ndk

Install android sdk

RUN wget -O /usr/src/android-sdk_r24.3.3-linux.tgz
RUN tar xvfz /usr/src/android-sdk_r24.3.3-linux.tgz -C /usr/src
RUN ln -s /usr/src/android-sdk-linux/ /usr/src/android-sdk

Update required sdk

RUN printf '#!/usr/bin/env python\nimport os\nw = ""\np = os.popen("/usr/src/android-sdk/tools/android list sdk | grep \"API 19\"")\nfor line in p.readlines():\n\tw += line.split("-")[0].strip()\n\tw += ","\nprint w[:-1]\n' > /usr/src/

RUN chmod +x /usr/src/

RUN printf '#!/usr/bin/expect -f\nset timeout 1800\nset cmd [lindex $argv 0]\nset licenses [lindex $argv 1]\nspawn {}$cmd\nexpect {\n\t"Do you accept the license \x27\x27*" {\n\t\texp_send "y\r"\n\t\texp_continue\n\t}\n\teof\n}\n' > /usr/src/

RUN ls /usr/src/
RUN chmod +x /usr/src/

RUN /usr/src/ "/usr/src/android-sdk/tools/android update sdk --all --no-ui --filter $(/usr/src/,platform-tools,build-tools-19.1.0"

Remove unneeded files

RUN rm -f /usr/src/android-ndk.bin
RUN rm -f /usr/src/android-sdk_r24.3.3-linux.tgz

ENV ANDROID_HOME /usr/src/android-sdk
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:$/usr/src/android-ndk

Docker Pull Command