Added android SDK and NDK to dockerfile

This commit is contained in:
Adam Lebsack 2016-11-24 10:55:46 +01:00
parent 61dd300f29
commit f670d0cdbe

View File

@ -1,15 +1,34 @@
FROM ubuntu:xenial
# Install the JDK
# We are going to need some 32 bit binaries because aapt requires it
# We are going to need some 32 bit binaries because apt requires it
# file is need by the script that creates NDK toolchains
ENV DEBIAN_FRONTEND noninteractive
RUN dpkg --add-architecture i386 && \
apt-get update -qq && \
apt-get install -y file git curl wget zip unzip bsdmainutils strace lsof \
build-essential libc6:i386 software-properties-common \
libstdc++6:i386 libgcc1:i386 libncurses5:i386 libz1:i386 \
s3cmd libconfig++9v5 python build-essential && \
apt-get install -y \
autoconf \
automake \
build-essential \
bsdmainutils \
curl \
file \
git \
lsof \
libc6:i386 \
libconfig++9v5 \
libgcc1:i386 \
libncurses5:i386 \
libstdc++6:i386 \
libz1:i386 \
python \
python-dev \
s3cmd \
software-properties-common \
strace \
unzip \
wget \
zip && \
curl -sL https://deb.nodesource.com/setup_4.x | bash - && \
apt-get install -y nodejs && \
echo oracle-java6-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
@ -27,8 +46,30 @@ ENV LANG "en_US.UTF-8"
ENV LANGUAGE "en_US.UTF-8"
ENV LC_ALL "en_US.UTF-8"
# ENV PATH ${PATH}:${NDK_HOME}
# Install the Android SDK
ENV ANDROID_SDK_VERSION r24.4.1
RUN cd /opt && curl -s https://dl.google.com/android/android-sdk_${ANDROID_SDK_VERSION}-linux.tgz | tar -xz
ENV ANDROID_HOME /opt/android-sdk-linux
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
RUN echo y | android update sdk --no-ui --all --filter tools > /dev/null && \
echo y | android update sdk --no-ui --all --filter platform-tools | grep 'package installed' && \
echo y | android update sdk --no-ui --all --filter build-tools-24.0.0 | grep 'package installed' && \
echo y | android update sdk --no-ui --all --filter extra-android-m2repository | grep 'package installed' && \
echo y | android update sdk --no-ui --all --filter android-24 | grep 'package installed'
# Install writable dir
RUN mkdir /tmp/opt && chmod 777 /tmp/opt
# Install the Android NDK
ENV ANDROID_NDK_VERSION r10e
RUN cd /opt && \
curl -sO http://dl.google.com/android/repository/android-ndk-${ANDROID_NDK_VERSION}-linux-x86_64.zip && \
unzip -q android-ndk-${ANDROID_NDK_VERSION}-linux-x86_64.zip && \
rm android-ndk-${ANDROID_NDK_VERSION}-linux-x86_64.zip
ENV ANDROID_NDK /opt/android-ndk-${ANDROID_NDK_VERSION}
RUN cd /opt && \
git clone https://github.com/facebook/watchman.git && \
cd watchman && \
git checkout v4.7.0 && \
./autogen.sh && ./configure && \
make && make install
RUN npm install -g react-native-cli