feat(android-local): vendored Docker build for APK with no host SDK #163
No reviewers
Labels
No labels
bug
documentation
duplicate
e-copy
e-features
e-mobile
enhancement
f-coverage
f-forensic
f-perf
f-privacy
forensic
good first issue
help wanted
infra
invalid
phase-a
phase-b
phase-c
phase-d
phase-e
phase-f
phase-g
phase-h
priority-1
priority-2
priority-3
privacy
question
v5
v6
video-hardening
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: forgejo_admin/exifcleaner-web#163
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/local-apk-build"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds a self-contained local APK build path. Only Docker is required on the host — no JDK, no Android SDK, no Node. Mirrors
.github/workflows/build-android.ymlinside a vendored image so anyone who clones the repo can build the APK with one command.Motivation: previously the only fast local path was to install forgejo-stack and reuse its
forgejo-stack/job-android:latestimage, or to hand-install Android Studio + JDK 21. This PR removes that coupling.Changes
docker/android-builder/Dockerfile—node:22-bookworm-slimbase + Temurin JDK 21 + Android cmdline-tools 11076708 +platforms;android-35+build-tools;35.0.0and34.0.0. The 34.0.0 build-tools is AGP 8.7.x's silent internal minimum; CI tolerates a missing 34.0.0 only because the Forgejo runner executes as root with a writable SDK dir. Local script runs as the host uid:gid, so we pre-install both.scripts/build-apk-local.sh— orchestrator. Builds the image on first run, then runs the container as the host uid:gid with the repo bind-mounted and three repo-local cache dirs for Gradle / yarn / HOME. Uses--network hoston both build and run because the default Docker bridge fails apt + adoptium downloads on hosts that share interfaces with co-resident bridges (e.g. forgejo-stack/internal).docs/android-apk.md— splits Prerequisites into Docker (Path A, recommended) and Native (Path B), adds aLocal Docker buildsection with the script's commands, timing table, and a pointer to the Dockerfile..gitignore— adds.docker-cache/(repo-local Gradle + yarn caches).Test plan
./scripts/build-apk-local.shon a host with no Android SDK, no JDK, no Node — only Docker. Producesandroid/app/build/outputs/apk/debug/app-debug.apk(4.6 MB, validAndroid packageperfile).--cleanremoves.docker-cache/;--rebuildforces image rebuild.--userflag.--network hostis supported on Docker Desktop 4.34+; older versions may need a different network mode.See the postmortem at forgejo-stack
docs/postmortems/2026-05-17-android-apk-ci.mdfor context on the JDK 21 / build-tools 34.0.0 / network requirements.