Skip to content

Instantly share code, notes, and snippets.

@lighta971
Last active May 14, 2016 21:53
Show Gist options
  • Save lighta971/0a486f12169ec2a3742e to your computer and use it in GitHub Desktop.
Save lighta971/0a486f12169ec2a3742e to your computer and use it in GitHub Desktop.
Ionic cordova android dockerfile
# Android development environment for ubuntu precise (12.04 LTS).
# version 0.0.1
# Start with ubuntu precise (LTS).
FROM ubuntu:12.04
MAINTAINER Aurel <[email protected]>
# Never ask for confirmations
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -qq && apt-get clean
RUN apt-get -y install python-software-properties git-core
# Dependencies to execute android
RUN apt-get install -y --no-install-recommends openjdk-7-jdk libgd2-xpm ia32-libs ia32-libs-multiarch
# Make sure the package repository is up to date
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update -qq && apt-get clean
RUN apt-get install -y bzip2 wget && apt-get clean
# Install android sdk
RUN wget http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz && \
tar -xvzf android-sdk_r23.0.2-linux.tgz && \
mv android-sdk-linux /usr/local/android-sdk && \
rm android-sdk_r23.0.2-linux.tgz
# Install android ndk
RUN wget http://dl.google.com/android/ndk/android-ndk64-r10-linux-x86_64.tar.bz2 && \
tar -xvjf android-ndk64-r10-linux-x86_64.tar.bz2 && \
mv android-ndk-r10 /usr/local/android-ndk && \
rm android-ndk64-r10-linux-x86_64.tar.bz2
# Install apache ant
RUN wget http://mirrors.ircam.fr/pub/apache//ant/binaries/apache-ant-1.9.4-bin.tar.gz && \
tar -xvzf apache-ant-1.9.4-bin.tar.gz && \
mv apache-ant-1.9.4 /usr/local/apache-ant && \
rm apache-ant-1.9.4-bin.tar.gz
# Add android tools and platform tools to PATH
ENV ANDROID_HOME /usr/local/android-sdk
ENV PATH $PATH:$ANDROID_HOME/tools
ENV PATH $PATH:$ANDROID_HOME/platform-tools
# Add ant to PATH
ENV ANT_HOME /usr/local/apache-ant
ENV PATH $PATH:$ANT_HOME/bin
# Install latest android (19 / 4.4.2) tools and system image.
RUN echo "y" | android update sdk --no-ui --force --filter platform-tools,android-19,build-tools-20.0.0
#Install nodejs
RUN add-apt-repository -y ppa:chris-lea/node.js && \
apt-get update -qq && \
apt-get install -y nodejs
# Append to $PATH variable.
RUN echo '\n# Node.js\nexport PATH="node_modules/.bin:$PATH"' >> /root/.bash_profile
# install cordova
RUN npm install -g cordova ionic
# Clean
RUN apt-get autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.npm /var/cache/apt/* && \
npm cache clear
VOLUME /workspace
WORKDIR /workspace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment