Skip to content

Latest commit

 

History

History
79 lines (45 loc) · 2.97 KB

README.md

File metadata and controls

79 lines (45 loc) · 2.97 KB

Docker Android Build Box

Build Status

Introduction

A docker image that can be used to supply an Android build environment. This is based on the fabulous work by Ming Chen and Conhea. So thanks goes to them for providing the base for this.

What's Inside

It includes the following components:

  • Ubuntu 17.10
  • Android SDK 22 25 26 27
  • Android NDK r16b
  • Android build tools 25.0.1 25.0.2 25.0.3 26.0.0 26.0.1 26.0.2 27.0.0 27.0.1 27.0.2 27.0.3
  • Android Emulator
  • extra-android-m2repository
  • extra-google-google_play_services
  • extra-google-m2repository
  • ConstraintLayout 1.0.1 1.0.2

Docker Pull Command

The docker image is publicly available on Docker Hub based on the Dockerfile in this repo, so there is nothing hidden in the image. To pull the latest docker image:

docker pull lowlevelstudios/android-build-box:latest

Usage

Use image to build Android project

You can use this docker image to build your Android project with a single docker command:

cd <android project directory>  # change working directory to your project root directory.
docker run --rm -v `pwd`:/project lowlevelstudios/android-build-box bash -c 'cd /project; ./gradlew build'

Use image for Bitbucket pipeline

If you have your Android project hosted on Bitbucket and want to use a bitbucket pipeline to build your Android project, this docker image can do it for you. Here is an example of a pipeline defined in bitbucket-pipelines.yml

image: bohsen/android-build-box:latest

pipelines:
  default:
    - step:
        script:
          - chmod +x gradlew
          - ./gradlew assemble

Docker Build Image

If you want to build the docker image locally, you can use the following docker build command to build the image. The image itself is up to 6 GB (can change significantly on every build if sdk components change), so check your free disk space before building it.

docker build -t android-build-box .

Contribution

If you want to enhance this docker image or fix something, feel free to send a pull request.

References