├── .gitignore ├── .travis.yml ├── README.md ├── LICENSE └── Dockerfile /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | 3 | services: 4 | - docker 5 | 6 | script: 7 | - docker build --quiet=true -t mike42/android-build-environment . 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Android Build on Docker Container 2 | === 3 | 4 | - Ubuntu 16.04 base. 5 | - Android 25 API 6 | - No NDK 7 | 8 | This is a remix of uber/android-build-environment and angeliski/android-build-environment. 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Uber Technologies, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Android Dockerfile 2 | # 3 | # Derived from uber/android-build-environment 4 | # via fork @ angeliski/android-build-environment 5 | 6 | FROM ubuntu:16.04 7 | 8 | MAINTAINER Michael Billington "michael.billington@gmail.com" 9 | 10 | ENV DOCKER_ANDROID_LANG en_US 11 | ENV DOCKER_ANDROID_DISPLAY_NAME mobileci-docker 12 | 13 | # Never ask for confirmations 14 | ENV DEBIAN_FRONTEND noninteractive 15 | 16 | # Update apt-get 17 | RUN rm -rf /var/lib/apt/lists/* 18 | RUN apt-get update 19 | RUN apt-get dist-upgrade -y 20 | 21 | RUN dpkg --add-architecture i386 22 | RUN apt-get update 23 | 24 | # Installing packages 25 | RUN apt-get install -y \ 26 | autoconf \ 27 | build-essential \ 28 | bzip2 \ 29 | curl \ 30 | gcc \ 31 | git \ 32 | groff \ 33 | lib32stdc++6 \ 34 | lib32z1 \ 35 | lib32z1-dev \ 36 | lib32ncurses5 \ 37 | libbz2-1.0:i386 \ 38 | libc6-dev \ 39 | libgmp-dev \ 40 | libmpc-dev \ 41 | libmpfr-dev \ 42 | libxslt-dev \ 43 | libxml2-dev \ 44 | locales \ 45 | m4 \ 46 | make \ 47 | ncurses-dev \ 48 | ocaml \ 49 | openssh-client \ 50 | pkg-config \ 51 | python-software-properties \ 52 | rsync \ 53 | software-properties-common \ 54 | unzip \ 55 | wget \ 56 | zip \ 57 | zlib1g-dev \ 58 | --no-install-recommends 59 | 60 | # Sets language to UTF8 : this works in pretty much all cases 61 | ENV LANG en_US.UTF-8 62 | RUN locale-gen $LANG 63 | 64 | # Install Java 65 | RUN apt-add-repository ppa:openjdk-r/ppa 66 | RUN apt-get update 67 | RUN apt-get -y install openjdk-8-jdk 68 | 69 | # Clean Up Apt-get 70 | RUN rm -rf /var/lib/apt/lists/* 71 | RUN apt-get clean 72 | 73 | # Install Android SDK 74 | RUN cd /usr/local/ && wget https://dl.google.com/android/repository/tools_r25.2.3-linux.zip && \ 75 | unzip tools_r25.2.3-linux.zip -d android-sdk && \ 76 | rm tools_r25.2.3-linux.zip 77 | 78 | ENV ANDROID_COMPONENTS platform-tools,android-25,build-tools-25.0.3 79 | 80 | # Install Android tools 81 | RUN echo y | /usr/local/android-sdk/tools/android update sdk --filter "${ANDROID_COMPONENTS}" --no-ui -a 82 | 83 | # Environment variables 84 | ENV ANDROID_HOME /usr/local/android-sdk 85 | ENV ANDROID_SDK_HOME $ANDROID_HOME 86 | ENV PATH ${INFER_HOME}/bin:${PATH} 87 | ENV PATH $PATH:$ANDROID_SDK_HOME/tools 88 | ENV PATH $PATH:$ANDROID_SDK_HOME/platform-tools 89 | ENV PATH $PATH:$ANDROID_SDK_HOME/build-tools/25.0.3 90 | 91 | # Export JAVA_HOME variable 92 | ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/ 93 | 94 | # Support Gradle 95 | ENV TERM dumb 96 | ENV JAVA_OPTS "-Xms512m -Xmx1024m" 97 | ENV GRADLE_OPTS "-XX:+UseG1GC -XX:MaxGCPauseMillis=1000" 98 | 99 | # Cleaning 100 | RUN apt-get clean 101 | 102 | # Add build user account, values are set to default below 103 | ENV RUN_USER mobileci 104 | ENV RUN_UID 5089 105 | 106 | RUN id $RUN_USER || adduser --uid "$RUN_UID" \ 107 | --gecos 'Build User' \ 108 | --shell '/bin/sh' \ 109 | --disabled-login \ 110 | --disabled-password "$RUN_USER" 111 | 112 | # Fix permissions 113 | RUN chown -R $RUN_USER:$RUN_USER $ANDROID_HOME $ANDROID_SDK_HOME 114 | RUN chmod -R a+rx $ANDROID_HOME $ANDROID_SDK_HOME 115 | 116 | # Creating project directories prepared for build when running 117 | # `docker run` 118 | ENV PROJECT /project 119 | RUN mkdir $PROJECT 120 | RUN chown -R $RUN_USER:$RUN_USER $PROJECT 121 | WORKDIR $PROJECT 122 | 123 | USER $RUN_USER 124 | RUN echo "sdk.dir=$ANDROID_HOME" > local.properties 125 | --------------------------------------------------------------------------------