logo
0
0
Login

Docker image for Android SDK

Docker image to build an Android app *.apk. The image contains the latest Android SDK tools, Gradle 8.3 and the Android SDK platform packages from packages.txt.

Automatic Build and Push

This repository is configured with GitHub Actions to automatically build and push Docker images when tags are pushed:

  1. Push a tag (e.g. git tag v1.0.0 && git push origin v1.0.0)
  2. GitHub Actions will build and push the image to Docker Hub with:
    • your-dockerhub-username/android-sdk:latest
    • your-dockerhub-username/android-sdk:v1.0.0

Setup Secrets

Before using, set these secrets in your GitHub repository settings:

  • DOCKER_HUB_USERNAME: Your Docker Hub username
  • DOCKER_HUB_TOKEN: Your Docker Hub access token

Note: Replace your-dockerhub-username in the workflow file with your actual Docker Hub username.

  • build-tools;34.0.0
  • build-tools;33.0.2
  • build-tools;32.0.0
  • build-tools;31.0.0
  • build-tools;30.0.3
  • build-tools;29.0.3
  • build-tools;28.0.3
  • build-tools;27.0.3
  • build-tools;26.0.3
  • platforms;android-34
  • platforms;android-34-ext8
  • platforms;android-33
  • platforms;android-32
  • platforms;android-31
  • platforms;android-30
  • platforms;android-29
  • platforms;android-28
  • platforms;android-27
  • platforms;android-26
  • platform-tools
  • extras;android;m2repository
  • extras;google;google_play_services
  • extras;google;m2repository
  • add-ons;addon-google_apis-google-24

The releases tags are oriented on the base of the Build Tools version from packages.txt.

Usage

The image can be used on different cloud build services or own hosted pipeline solutions like Travis CI, CircleCI or GitLab CI/CD.

CircleCI

CircleCI supports the direct specification of a Docker image and checks out the source code in it: https://circleci.com/docs/2.0/circleci-images/

Therefore you execute your CI script directly in the container.

Example:

# .circleci/config.yml version: 2.1 jobs: build: docker: - image: mobiledevops/android-sdk-image:34.0.0 steps: - checkout - run: name: Android Build command: ./gradlew clean assembleRelease

Example Project: https://github.com/mobiledevops/android-ci-demo

Travis CI

To use a Docker container on Travis CI, you have to pull, run and execute it manually because Travis CI has no Docker executor: https://docs.travis-ci.com/user/docker/

And to prevent to do a new checkout of the source code in the Docker image, you can copy the code into the container via tar (see https://docs.docker.com/engine/reference/commandline/cp/). To execute your CI script, use docker exec with the container name.

Example:

# .travis.yml dist: bionic services: - docker env: - DOCKER_IMAGE=mobiledevops/android-sdk-image:34.0.0 before_install: - docker pull $DOCKER_IMAGE - docker run --name android_ci -t -d $DOCKER_IMAGE /bin/sh - tar Ccf . - . | docker exec -i android_ci tar Cxf /home/mobiledevops/app - script: - docker exec android_ci ./gradlew clean assembleRelease

Example Project: https://github.com/mobiledevops/android-ci-demo

GitLab CI

GitLab CI/CD supports to run jobs on provided Docker images: https://docs.gitlab.com/runner/executors/docker.html

Therefore you execute your CI script directly in the container.

Example:

# .gitlab-ci.yml image: mobiledevops/android-sdk-image:34.0.0 stages: - build release_build: stage: build tags: - shared script: - ./gradlew clean assembleRelease

Example Project: https://gitlab.com/mobiledevops/android-ci-demo


Contributing

Code of Conduct

About

No description, topics, or website provided.
62.00 KiB
0 forks0 stars3 branches12 TagREADMEMIT license
Language
Dockerfile64.3%
Shell13.1%
Makefile9.6%
Others13%