Skip to content

android-tools

CI image with JDK 21 and the Android SDK, for building, testing and linting Android apps (cicd spec 0124).

Release v0.1.1, 2026-11-04. Built on ci-base. Source: phpboyscout/images/android-tools.

Pin it

image: registry.gitlab.com/phpboyscout/images/android-tools:v0.1.1

Pin the full version. Each release also moves its minor tag and latest, which change under you.

Variant Tags
default v0.1.1, v0.1

Later releases (v0.1.2) are tagged but have no image, because their publish was held, so this page describes v0.1.1.

About this image

The Android track's CI image: debug builds, unit tests and Android lint.

image: registry.gitlab.com/phpboyscout/images/android-tools:vX.Y.Z
tags: [amd64]

Built from ci-base (Wolfi: bash, git, curl, jq, python3), it adds:

What Version From
JDK, with jmods 21 Wolfi openjdk-21-default-jdk, openjdk-21-jmods
Android SDK command-line tools build 15859902 Google, SHA-256 verified
platform-tools as installed by sdkmanager Google
platforms;android-37.0 Google
build-tools;36.0.0, build-tools;37.0.0 Google

ANDROID_HOME=/opt/android-sdk, JAVA_HOME=/usr/lib/jvm/java-21-openjdk, and sdkmanager and adb are on PATH. It runs as the non-root ci user.

Not included: Gradle (your wrapper fetches it), a dependency cache, the NDK, CMake, the emulator and system images, and any signing key or secret.

The design and its reasons are in cicd's spec 0124.

Using it

android:
  image: registry.gitlab.com/phpboyscout/images/android-tools:vX.Y.Z
  tags: [amd64]
  variables:
    GRADLE_USER_HOME: $CI_PROJECT_DIR/.gradle
    GRADLE_OPTS: -Dorg.gradle.workers.max=4
  cache:
    key:
      files:
        - gradle/wrapper/gradle-wrapper.properties
        - gradle/libs.versions.toml
    paths:
      - .gradle/caches/
      - .gradle/wrapper/
  script:
    - ./gradlew --no-daemon assembleDebug testDebugUnitTest lintDebug
  • Tag the job amd64. Google ships no Linux arm64 SDK binaries, and the image is amd64 only. An untagged job can land on an arm64 runner and fail.
  • Keep GRADLE_USER_HOME in the checkout. The job runs as ci, which can write $CI_PROJECT_DIR but not the image's own directories.
  • Bound memory yourself. The pool runners set no memory cap. Set org.gradle.jvmargs=-Xmx2g in gradle.properties and cap workers, as above. A build of that shape peaks at about 3 to 4 GB.
  • The SDK is read-only. If your build needs a package that isn't here, it fails with an error naming it. Ask for it here (an issue on this project) rather than installing it in your job.

Licence

Using the Android SDK means accepting Google's Android SDK licence. The image accepts android-sdk-license, and only that one, on the estate's behalf (spec 0124 D5). This repository's own files are MIT.

How it is tested

Pipelines on main, on tags, and on merge requests that change the Dockerfile, the fixture or the pipeline push the scanned image as sha-<commit> and build tests/fixture in it: a minimal Android app on the same AGP version as its main consumer, with one unit test and lint. A release can't be published unless that passes.

Everything installed

Contents not yet published. This image's releases do not carry an SBOM yet. Until they do, the README above describes what it adds, and the Dockerfile is the full record.