Public Repository

Last pushed: 2 years ago
Short Description
Docker environment to build Android apps with GitLab (or any CI that can execute Docker)
Full Description

android-sdk-docker

This docker image can be used to build Android Gradle projects with Java 7. The image is available on DockerHub

Contains:

  • Android SDK: r24.4.1
  • Build tools
  • Android API
  • Support maven repository
  • Google maven repository
  • Arm emulator: v21
  • Platform tools

I installed the SDK using this filter:

tools,
platform-tools,
build-tools-23.0.2,
build-tools-22.0.1,
android-23,
android-22,
android-21,
sys-img-armeabi-v7a-android-23,
addon-google_apis-google-23,
addon-google_apis-google-22,
extra-android-m2repository,
extra-android-support

If you need something else, change the updateSDK.sh script and rebuild the image.

Build image

docker build -t lerk/android .

Push build version to repository

docker push lerk/android

Usage

GitLab CI

This is what my .gitlab-ci.yml looks like:

image: lerk/android

stages:
  - build

build:
  stage: build
  script:
    - ./gradlew build
  only:
    - master

Without GitLab

docker pull lerk/android

Change directory to your project directory, then run:

docker run --tty --interactive --volume=$(pwd):/opt/workspace --workdir=/opt/workspace --rm lerk/android  /bin/sh -c "./gradlew build"
Docker Pull Command
Owner
lerk