A minimal Android app skeleton with a fully containerized, CLI-driven Gradle
build. No JDK, Android SDK, or Gradle needed on the host — everything runs
inside a podman container defined by the Containerfile. The only host
dependency is podman (and adb, if you want to install on a device).
Containerfile Fedora + JDK 21 + Android SDK + Gradle toolchain
Makefile build / shell / install targets (podman wrapper)
build.gradle root project — pins the Android Gradle Plugin version
settings.gradle project name + module list
app/ the application module (one-activity skeleton)
Build the toolchain image once:
make imageBuild a debug APK (rebuilds the image if needed):
make debugOutput: app/build/outputs/apk/debug/app-debug.apk
Other targets:
make release # assembleRelease
make clean # gradle clean
make gradle ARGS="tasks" # run any gradle task in the container
make shell # interactive shell inside the build containerThe Gradle cache is persisted in a named volume (android-gradle-cache) so
incremental builds and the debug keystore survive between runs.
The build stays containerized; only adb runs on the host:
sudo dnf install android-tools # Fedora
make install # adb install -r the debug APKReplace each placeholder value below. The package id (com.example.app) must be
changed in all four of its locations together — namespace, applicationId, the
source directory, and the package declaration.
| Placeholder | Value | Where |
|---|---|---|
| Package id | com.example.app |
app/build.gradle (namespace + applicationId), source dir app/src/main/java/com/example/app/, package line in MainActivity.java |
| Project name | AndroidApp |
settings.gradle (rootProject.name) |
| App label | AndroidApp |
app/src/main/res/values/strings.xml (app_name) |
| Image / cache names | android-builder, android-gradle-cache |
Makefile (IMAGE, GRADLE_CACHE) — optional |
| Launcher icon | placeholder "A" art | app/src/main/res/drawable/ic_launcher_foreground.xml |
Bump SDK / build-tools / Gradle versions in the Containerfile ARGs if needed.
- Container-only by design. There is no Gradle wrapper (
gradlew); the pinned Gradle version lives solely in theContainerfile. Build throughmake, not on the host. - SDK level, build-tools, and Gradle versions are all
ARGs at the top of theContainerfile— change them in one place.