devbymegha/androidci:latest
Android SDK Docker image for CI/CD builds with GitLab CI and GitHub Actions.
Supports Android app builds, APK/AAB generation, Gradle caching, and multi-version Android SDK support.
ā
Android SDK API 24 ā 36
ā
Java 17
ā
Gradle support
ā
APK / AAB builds
ā
GitLab CI support
ā
GitHub Actions support
ā
Gradle caching enabled
ā
Intel + ARM64 (Apple Silicon M1/M2/M3)
docker pull devbymegha/androidci:latest
Build Android app:
docker run --rm \
-v "$PWD:/workspace" \
-w /workspace \
devbymegha/androidci:latest \
./gradlew assembleDebug
Release build:
docker run --rm \
-v "$PWD:/workspace" \
-w /workspace \
devbymegha/androidci:latest \
./gradlew assembleRelease
| Component | Version |
|---|---|
| Ubuntu | 24.04 |
| Java | 17 |
| Android SDK | API 24 ā 36 |
| Build Tools | 30.0.3 / 33.0.2 / 34.0.0 / 35.0.0 |
Create .gitlab-ci.yml in the root of your Android project:
image: devbymegha/androidci:latest
stages:
- build
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
before_script:
# Make Gradle executable
- chmod +x ./gradlew
# Enable local Gradle cache
- export GRADLE_USER_HOME="$(pwd)/.gradle"
cache:
key: ${CI_PROJECT_ID}
paths:
- .gradle/
build-debug:
stage: build
script:
# Clean previous builds
- ./gradlew clean
# Generate debug APK
- ./gradlew assembleDebug
artifacts:
name: "debug-apk-${CI_COMMIT_SHORT_SHA}"
expire_in: 2 weeks
paths:
- app/build/outputs/apk/debug/app-debug.apk
Push code:
git add .
git commit -m "setup gitlab ci"
git push
GitLab automatically starts the build and generates APK artifacts.
Create:
.github/workflows/android-ci.yml
name: Android CI
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
container:
image: devbymegha/androidci:latest
env:
GRADLE_USER_HOME: ${{ github.workspace }}/.gradle
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Cache Gradle
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*','**/gradle-wrapper.properties') }}
- name: Give execute permission
run: chmod +x gradlew
- name: Clean build
run: ./gradlew clean
- name: Build APK
run: ./gradlew assembleDebug
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: app-debug-apk
path: app/build/outputs/apk/debug/app-debug.apk
Push code:
git add .
git commit -m "setup github action"
git push
GitHub Actions ā Actions tab ā APK artifact available after build completes.
Content type
Image
Digest
sha256:9239a4e57ā¦
Size
1.4 GB
Last updated
4 months ago
docker pull devbymegha/androidci