Node 20, OpenJDK 17, Ruby, Bundler & gcloud for Android/React Native CI builds (Bitbucket, etc.)
1.8K
Copy this content into the Full Description field of your Docker Hub repository.
Docker image for building Android (React Native) apps in CI pipelines. Pre-installs Node, Java, Ruby, Bundler and Google Cloud CLI so pipelines skip repeated apt-get install on every run.
Our Bitbucket pipeline was slow because each Android build step had to:
apt-get update and install OpenJDK 17, Ruby, build-essential, ca-certificates, etc.google-cloud-cligem install bundlerThis added 2–5 minutes to every build. We created this image to pre-install these tools once and reuse them across runs.
This image provides a ready-to-use environment for Android CI that includes:
| Component | Version | Purpose |
|---|---|---|
| Node.js | 20 | React Native, Yarn, Metro bundler |
| OpenJDK | 17 | Gradle and Android builds |
| Ruby | 3.1 | Fastlane |
| Bundler | (latest) | Ruby gem management for Fastlane |
| Google Cloud CLI | (latest) | Workload Identity Federation (WIF) for Play Store deploy |
| locales | en_US.UTF-8 | Avoid locale warnings in CI |
Base image: Debian Bookworm Slim (node:20-bookworm-slim)
Designed for Bitbucket Pipelines (or similar CI) that build React Native Android apps and deploy to Google Play. The CI runner must provide the Android SDK; this image does not include it (SDK is platform-specific and large).
- step:
name: Android · Build AAB
image: optsoft/android:latest
script:
- export ENV=development
- export FASTLANE_ANDROID_LANE=deploy_internal
- export PREBUILT_CI_IMAGE=1
- chmod +x scripts/ci-android.sh
- ./scripts/ci-android.sh
Set PREBUILT_CI_IMAGE=1 so the CI script skips the apt-get install block.
yarn install and bundle install still run per pipeline.Not supported. Mounting the macOS Android SDK into this Linux container fails because the SDK contains macOS binaries (cmake, ninja, hermes) that cannot run on Linux. For local Android builds on Mac, run directly on the host (no Docker).
If you build on Apple Silicon, the image is arm64. Bitbucket runs Linux amd64. Rebuild for amd64 before pushing:
docker build --platform linux/amd64 -f Dockerfile.android-ci -t optsoft/android:latest .
docker push optsoft/android:latest
latest – Current stable build2025-02) – For pinning specific buildsBuilt from a Dockerfile in a React Native project. The Dockerfile is maintained alongside the app and optimized for that pipeline.
Content type
Image
Digest
sha256:6b407e60b…
Size
663 MB
Last updated
7 months ago
docker pull optsoft/android