Public Repository

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

FROM ubuntu

MAINTAINER Heechul Ryu "ryuhcii@gmail.com"

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 https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool
RUN wget -O /usr/local/bin/apktool.jar https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.0.0.jar
RUN chmod +x /usr/local/bin/apktool /usr/local/bin/apktool.jar

Install ndk

RUN wget -O /usr/src/android-ndk.bin http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.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 http://dl.google.com/android/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/get_sdk_num.sh

RUN chmod +x /usr/src/get_sdk_num.sh

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/android-accept-licenses.sh

RUN ls /usr/src/
RUN chmod +x /usr/src/android-accept-licenses.sh

RUN /usr/src/android-accept-licenses.sh "/usr/src/android-sdk/tools/android update sdk --all --no-ui --filter $(/usr/src/get_sdk_num.sh),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
Owner
ryuheechul