summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraguestuser <aguestuser@risup.net>2017-04-17 00:34:21 -0400
committeraguestuser <aguestuser@risup.net>2017-04-30 20:05:09 -0400
commita7b4f463e4ffc282814ef74daf18c74581fc3a7d (patch)
tree89f456448b0be53a7f7de63968ae31a877891c80
parent9edd5d6b3f9e7019fe01867ad4e37d2753d77e18 (diff)
[ag] Update dockerfile to match config in passing local build
* PROBLEM: the build fails on gitlab in a debian-based docker container * BUT: i (@aguestuser) have a recently-achieved passing build on a debian laptop * ATTEMPTED SOLUTION: construct a dockerfile that matches my local configuration as precisely as possible * PROGRESS: the build gets further than it did before -- getting part of the way through the `buildNative` gradle script before failing * REMAINING FAILURE: several arm64 cross-compile steps in the `ndk-build` step fail because they depend on [neon](https://developer.android.com/ndk/guides/cpu-arm-neon.html): ```shell [arm64-v8a] Compile : crypto_static <= aesv8-armx-64.S openssl/crypto/aes/asm/aesv8-armx-64.S:35:2: error: instruction requires: neon eor v0.16b,v0.16b,v0.16b ^ openssl/crypto/aes/asm/aesv8-armx-64.S:36:2: error: instruction requires: neon ld1 {v3.16b},[x0],#16 ^ openssl/crypto/aes/asm/aesv8-armx-64.S:38:2: error: instruction requires: neon ld1 {v1.4s,v2.4s},[x3],#32 ``` * PROPOSED NEXT STEPS: * consult team to see if there's any collective wisdom about `neon` * look for ways to analyze diff of c dependencies in local machine v. docker instance * consider using ubuntu or debian:sid as the base image for the android container?
-rw-r--r--app/build.gradle4
-rw-r--r--docker/android-sdk.dockerfile91
2 files changed, 93 insertions, 2 deletions
diff --git a/app/build.gradle b/app/build.gradle
index cd7e6e21..b6bb39ff 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -2,8 +2,8 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 23
- buildToolsVersion '25.0.0'
-
+ buildToolsVersion '25.0.2'
+;
signingConfigs {
release {
storeFile project.hasProperty('storeFileProperty') ? file(storeFileProperty) : null
diff --git a/docker/android-sdk.dockerfile b/docker/android-sdk.dockerfile
new file mode 100644
index 00000000..dddf54c6
--- /dev/null
+++ b/docker/android-sdk.dockerfile
@@ -0,0 +1,91 @@
+FROM debian:stretch
+
+MAINTAINER LEAP Encryption Access Project <info@leap.se>
+LABEL Description="Android SDK baseimage based on debian:stretch" Vendor="LEAP" Version="0.0.1"
+
+# ------------------------------------------------------
+# --- Install System Dependencies
+
+# Update Debian
+RUN apt-get update -qq
+
+# Install Debian Packages
+RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
+ # the basics
+ wget unzip git locales \
+ # java stuff
+ openjdk-8-jdk maven \
+ # c libraries
+ make clang lib32stdc++6 lib32z1 # (incl. 32-bit compatible versions)
+
+# libgcc-6-dev-arm64-cross
+
+# Set Locale
+RUN locale-gen en_US.UTF-8
+RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
+
+# ------------------------------------------------------
+# --- Install Android SDK Tools
+
+ENV ANDROID_HOME /opt/android-sdk-linux
+ENV SDK_TOOLS_VERSION "25.2.5"
+
+# Install SDK Tools
+RUN cd /opt \
+ && wget -q -O sdk-tools.zip \
+ https://dl.google.com/android/repository/tools_r${SDK_TOOLS_VERSION}-linux.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 Platform Tools Package
+RUN echo y | sdkmanager "platform-tools" # echo y to accept google licenses
+
+# Install Android Support Repositories
+RUN echo y | sdkmanager "extras;android;m2repository"
+
+# Install Target SDK Packages (Please keep in descending order)
+RUN echo y | sdkmanager "platforms;android-25"
+RUN echo y | sdkmanager "platforms;android-24"
+RUN echo y | sdkmanager "platforms;android-23"
+
+# Install Build Tools (Please keep in descending order)
+RUN echo y | sdkmanager "build-tools;25.0.2"
+RUN echo y | sdkmanager "build-tools;24.0.3"
+RUN echo y | sdkmanager "build-tools;23.0.3"
+
+# ------------------------------------------------------
+# --- Install Android NDK (for running C code)
+
+ENV ANDROID_NDK_HOME ${ANDROID_HOME}/ndk-bundle
+
+# Install NDK packages from sdk tools
+
+RUN echo y | sdkmanager "ndk-bundle"
+RUN echo y | sdkmanager "cmake;3.6.3155560"
+RUN echo y | sdkmanager "lldb;2.3"
+
+# Update PATH
+
+ENV PATH ${PATH}:${ANDROID_NDK_HOME}
+
+
+# ------------------------------------------------------
+# --- Install Android Emulator
+
+
+# RUN echo y | sdkmanager "emulator"
+
+# System Images for emulators
+# RUN echo y | sdkmanager "system-images;android-25;google_apis;armeabi-v7a"
+# RUN echo y | sdkmanager "system-images;android-24;google_apis;armeabi-v7a"
+# RUN echo y | sdkmanager "system-images;android-23;google_apis;armeabi-v7a"
+# RUN echo y | sdkmanager "system-images;android-23;google_apis;arm64-v8a"
+
+# ------------------------------------------------------
+# --- Cleanup
+
+RUN apt-get clean
+