Easily build and automate your Cordova applications using Docker, fully optimized for Android API Level 34. Perfect for local development, CI/CD pipelines, and ensuring consistency across build environments.
This repository provides a Docker-based environment for building Cordova Android applications targeting Android API Level 34. It includes all necessary dependencies, making it an ideal solution for both developers and DevOps teams.
You can find the pre-built Docker image on Docker Hub:
https://hub.docker.com/r/kushallikhi/cordova-android-builder-api-34
To use this Docker image, you'll need either:
- Docker: For local development.
- CI/CD Pipeline: Such as GitHub Actions, Jenkins, etc.
This Docker image comes with the following pre-installed:
- Node.js v20 LTS
- Cordova v12.0.0
- Gradle v8.7
- Android Platform Tools
- Android Build Tools 34.0.0
- Android SDK API Level 34
To pull the Docker image from Docker Hub, run:
docker pull kushallikhi/cordova-android-builder-api-34
To verify that all dependencies are correctly installed and configured:
docker run -v <local-app-src>:/opt/src --rm kushallikhi/cordova-android-builder-api-34 cordova requirements
To build your Cordova Android application:
docker run -v <local-app-src>:/opt/src --rm kushallikhi/cordova-android-builder-api-34 cordova build
You can also start an interactive shell session within the container for more control:
docker run -it -v <local-app-src>:/opt/src --rm kushallikhi/cordova-android-builder-api-34 bash
From here, you can perform tasks such as adding platforms, checking requirements, and building the application:
root@cordova:/opt/src# cordova platform add android
root@cordova:/opt/src# cordova requirements
root@cordova:/opt/src# cordova build
The generated APK will be located at: /opt/src/platforms/android/app/build/outputs/apk/
You can extend this Docker image with your own custom configurations by creating a Dockerfile:
FROM kushallikhi/cordova-android-builder-api-34
# Add your custom steps here
You may need additional Android packages not included in this image. You can install them interactively or by extending the Dockerfile.
Attach to the running container:
docker exec -it <cordova-container-name> bash
Install the required packages and accept the licenses:
root@cordova:/opt/src# sdkmanager "platforms;android-30"
To list available packages:
docker run -it --rm kushallikhi/cordova-android-builder-api-34 sdkmanager --list
Version | Description | Date |
---|---|---|
0.9.4 | Initial release with API Level 34 support | 2024-08-20 |
Contributions are welcome! Please feel free to submit issues and pull requests. Follow the standard GitHub Flow when contributing.
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have any questions, feel free to open an issue on the GitHub repository.
This setup provides a consistent and reliable environment for your Cordova Android builds, making your development and deployment processes smoother and more efficient.