summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authoraguestuser <aguestuser@risup.net>2017-05-04 17:26:28 +0200
committerkwadronaut <kwadronaut@leap.se>2017-05-04 17:34:06 +0200
commit59985587c758f93844df7600f18c0837c672f259 (patch)
tree044b866f2bd9a83246a6128c0e6f8afc4ce5a9d0 /docker
parent0688c9e8ceab724874bd795f35dc64f498c416b0 (diff)
parent4333fd93e3a1c64f6c0fb42be9ae29879ea2c7f0 (diff)
Update README, Dockerfile to build, smoothing on-boarding
Closes https://0xacab.org/leap/bitmask_android/merge_requests/1 README: add detailed instructions on installing and compiling provide workarounds for gotchas setting up emulator on 64-bit debian provide updated dockerfile & offer instructions for building in docker Docker: move dockerfiles to registry contained w/in bitmask_android repo provide separate dockerfiles for sdk (base), ndk, and emulator images resolve issues causing containerized build to fail, including: upstream ics-openvpn conflict with clang (:. transitively with ndk > r12b) (subtle!) missing dependency of ndk r12b on file (message: "missing file" meant a missing program called "file" not an actual missing file) missing locales causing errors in copyIcsOpenVPNFiles build step (resolved by generating all locales in dockerfile) silent failure in sdknmanager's isntallation of platforms;android-23 during image build causing install failure in remote (but not local!) containers Signed-off-by: kwadronaut <kwadronaut@leap.se>
Diffstat (limited to 'docker')
-rw-r--r--docker/android-emulator.dockerfile24
-rw-r--r--docker/android-ndk.dockerfile32
-rw-r--r--docker/android-sdk.dockerfile65
3 files changed, 121 insertions, 0 deletions
diff --git a/docker/android-emulator.dockerfile b/docker/android-emulator.dockerfile
new file mode 100644
index 00000000..0201312b
--- /dev/null
+++ b/docker/android-emulator.dockerfile
@@ -0,0 +1,24 @@
+FROM 0xacab.org:4567/leap/bitmask_android/android-sdk:latest
+
+MAINTAINER LEAP Encryption Access Project <info@leap.se>
+LABEL Description="Android SDK baseimage based on debian:stretch" Vendor="LEAP" Version="25"
+
+# ------------------------------------------------------
+# --- System Dependencies
+
+# ensure GL compatibility
+
+RUN apt-get update -qq
+RUN DEBIAN_FRONTEND=noninteractive apt-get install -y mesa-utils
+ENV ANDROID_EMULATOR_USE_SYSTEM_LIBS=1
+
+# ------------------------------------------------------
+# --- Install Android Emulator
+
+# Install Android SDK emulator package
+RUN echo y | sdkmanager "emulator"
+
+# Install System Images for emulators
+RUN echo y | sdkmanager "system-images;android-25;google_apis;x86_64"
+RUN echo y | sdkmanager "system-images;android-24;google_apis;x86_64"
+RUN echo y | sdkmanager "system-images;android-23;google_apis;x86_64"
diff --git a/docker/android-ndk.dockerfile b/docker/android-ndk.dockerfile
new file mode 100644
index 00000000..0a3eabfd
--- /dev/null
+++ b/docker/android-ndk.dockerfile
@@ -0,0 +1,32 @@
+FROM 0xacab.org:4567/leap/bitmask_android/android-sdk:latest
+
+MAINTAINER LEAP Encryption Access Project <info@leap.se>
+LABEL Description="Android NDK image based on android-sdk baseimage" Vendor="LEAP" Version="r12b"
+
+# ------------------------------------------------------
+# --- Install System Dependencies
+
+RUN apt-get update -qq
+RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
+ make gcc file lib32stdc++6 lib32z1 # JNI build dependencies w/ 32-bit compatible C libs
+
+# ------------------------------------------------------
+# --- Install Android NDK (for running C code)
+
+# NOTE(@aguestuser|4.23.17)
+# We woud like to use te current version of Android NDK (r14b) but cannot
+# due to pinned dependency on year-old version of `ics-openvpn`
+# which has transitive dependency on `openssl` which will not compile with `clang`
+# (starting in 13b, android ndk uses `clang` isntead of `gcc`)
+# Upon rebasing onto to current HEAD of `ics-openvpn` and resolving conflicts, we
+# should update to current version of `ndk`.
+
+ENV ANDROID_NDK_VERSION "r12b"
+ENV ANDROID_NDK_HOME ${ANDROID_HOME}/android-ndk-${ANDROID_NDK_VERSION}
+ENV ANDROID_NDK_URL http://dl.google.com/android/repository/android-ndk-${ANDROID_NDK_VERSION}-linux-x86_64.zip
+
+RUN curl -L $ANDROID_NDK_URL -o ndk.zip \
+ && unzip ndk.zip -d $ANDROID_HOME \
+ && rm -rf ndk.zip
+
+ENV PATH ${PATH}:${ANDROID_NDK_HOME}
diff --git a/docker/android-sdk.dockerfile b/docker/android-sdk.dockerfile
new file mode 100644
index 00000000..4044a7ec
--- /dev/null
+++ b/docker/android-sdk.dockerfile
@@ -0,0 +1,65 @@
+FROM debian:stretch
+
+MAINTAINER LEAP Encryption Access Project <info@leap.se>
+LABEL Description="Android SDK baseimage based on debian:stretch" Vendor="LEAP" Version="25.2.5"
+
+# ------------------------------------------------------
+# --- Install System Dependencies
+
+RUN apt-get update -qq
+RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
+ # the basics
+ curl unzip git locales \
+ # java stuff
+ openjdk-8-jdk maven
+
+# ------------------------------------------------------
+# --- Set Locales
+
+# Generate All Locales
+RUN cp /usr/share/i18n/SUPPORTED /etc/locale.gen
+RUN locale-gen
+
+# Set Default Locale
+RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
+ENV LANG en_US.UTF-8
+
+# ------------------------------------------------------
+# --- Install Android SDK Tools
+
+ENV ANDROID_SDK_VERSION "25.2.5"
+ENV ANDROID_HOME /opt/android-sdk-linux
+ENV ANDROID_SDK_URL https://dl.google.com/android/repository/tools_r${ANDROID_SDK_VERSION}-linux.zip
+
+# Install SDK Tools
+RUN curl -L $ANDROID_SDK_URL -o sdk-tools.zip \
+ && unzip -q sdk-tools.zip -d $ANDROID_HOME \
+ && rm -f sdk-tools.zip
+
+# Update PATH
+ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools
+
+# ------------------------------------------------------
+# --- Install Android SDK Tools Packages
+
+# Install Platform Tools Package
+RUN echo y | sdkmanager "platform-tools" # echo y to accept google licenses
+
+# Install Android Support Repositories
+RUN sdkmanager "extras;android;m2repository"
+
+# Install Build Tools (Please keep in descending order)
+RUN sdkmanager "build-tools;25.0.2"
+RUN sdkmanager "build-tools;25.0.0"
+RUN sdkmanager "build-tools;24.0.3"
+RUN sdkmanager "build-tools;23.0.3"
+
+# Install Target SDK Packages (Please keep in descending order)
+RUN sdkmanager "platforms;android-25"
+RUN sdkmanager "platforms;android-24"
+RUN sdkmanager "platforms;android-23"
+
+# ------------------------------------------------------
+# --- Cleanup
+
+RUN apt clean