Building Cordova apps with Docker
Docker is each day a more powerful and useful tool, in this case, it was used to build a Cordova app.
After trying some docker images, the one that worked was:
https://hub.docker.com/r/walterwhites/cordova
# run in mounting the local folder where the project is into container src folder
docker run -ti -v ${PWD}:/src walterwhites/cordova
After running it some issues appeared, but there is a solution mentioned on the docs:
"You have not accepted the license agreements of the following SDK components" when you build your app, you need to accept licenses"
You just follow the steps, and it works.
Then to build the cordova app you run:
# dev / debug
cordova build android
# release
cordova build android --release
To change the name of the output file, you can edit the /platforms/android/app/gradle.build file, and add inside the android default configs the following line: