1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
# Version: 1.0
# Dockerfile for building libzip for android
# https://github.com/dec1/libzip.git
# creates docker container with all tools, libraries and sources required to build libzip for android.
# Author: Declan Moran
# www.silverglint.com
# Usage:
#---------
# download the libzip repository
# > git clone https://github.com/dec1/libzip.git
# > cd libzip
#
# build docker image "my_img_zip" from the dockerfile in "docker" dir
# > docker build -t my_img_zip ./android/docker
#
# run docker container "my_ctr_zip" from this image, mounting the current dir. (Need to pass absolute host paths to mount volume- hence "pwd")
# > docker run -v $(pwd):/home/docker-share/libzip -it --entrypoint=/bin/bash --name my_ctr_zip my_img_zip
#
# Now inside docker container
# $ cd /home/docker-share/libzip/android
#
# Modify ./do.sh (on host), to match the boost and android ndk versions/paths in the "Configure here" section below
# Build from running docker container.
# $./do.sh
#
# "./build" dir contains required build, but owned by root. chown to your username/group
# > sudo chown -R <userid>:<groupid> ./build
# > sudo chown -R <userid>:<groupid> ./install
#
# Exit container, when build is finished.
# $ exit
#
FROM ubuntu:18.04
## --------------------------------------------------------------------
## Configure here
# ---------------------------------------------------------------------
# ---------------------------------------------------------------------
# Here you can speciofy exactly what android ndk (and sdk) version you want to use.
# (2) Android SDK
# https://developer.android.com/studio#downloads
ARG SDK_URL_BASE=https://dl.google.com/android/repository
ARG SDK_FILE=sdk-tools-linux-4333796.zip
# the sdk platform to use
# https://developer.android.com/guide/topics/manifest/uses-sdk-element
ARG ANDROID_SDK_PLATFORM_VERS="platforms;android-28"
# (3) Android NDK
# https://developer.android.com/ndk/downloads
ARG NDK_URL_BASE=https://dl.google.com/android/repository
ARG NDK_FILE=android-ndk-r19c-linux-x86_64.zip
# ---------------------------------------------------------------------
## --------------------------------------------------------------------
RUN apt-get update
RUN apt-get -y dist-upgrade
# for downloading archives
RUN apt-get -y install wget
# for unzipping downloaded android archives
RUN apt-get -y install zip
RUN apt-get -y install cmake
RUN apt-get -y install lib32z1
# need this this to install some (32 bit) prerequisites for android builds
RUN dpkg --add-architecture i386
RUN apt-get update
RUN apt-get -y dist-upgrade
RUN apt-get install -y libc6:i386 libncurses5:i386 libstdc++6:i386 libbz2-1.0:i386
# need c compiler to set up create boost build system (before building boost with it and android toolchain)
RUN apt-get -y install build-essential
RUN apt-get -y install libc6-dev-i386
RUN apt-get -y install clang
RUN apt-get -y install openjdk-8-jdk
#--------------------------------------
ARG ANDROID_HOME=/home/android
WORKDIR ${ANDROID_HOME}
# SDK
# ----
# download android sdk command line tools
RUN wget ${SDK_URL_BASE}/$SDK_FILE
RUN unzip $SDK_FILE
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools
RUN yes | sdkmanager --licenses
RUN sdkmanager "platform-tools" $ANDROID_SDK_PLATFORM_VERS
#RUN sdkmanager "platform-tools" "platforms;android-28"
# NDK
# ----
RUN wget ${NDK_URL_BASE}/$NDK_FILE
RUN unzip $NDK_FILE
|