Docker image include Android SDK for building Ionic framework application.
In my work, I want to build the android application develop by ionic framework via gitlab-runner with Docker driver.
build:
image: kusumoto/docker-ionic-android-sdk
script:
- npm install
- mkdir www
- ionic cordova build android
artifacts:
paths:
- platforms/android/build/outputs/apk/*.apk
If you want to run or build the ionic project in computer but doesn't have Android Studio, Android SDK or Ionic Framework and this computer installed Docker. You can use helper command
- Restore npm package
docker run --rm -v $(pwd):/ionicapp kusumoto/docker-ionic-android-sdk npm install
- Preview Ionic web app in your web browser
docker run --rm -v $(pwd):/ionicapp -p 8100:8100 kusumoto/docker-ionic-android-sdk ionic serve
- Build android apk output file
docker run --rm -v $(pwd):/ionicapp kusumoto/docker-ionic-android-sdk ionic cordova build android
You can use adb (Android debug bridge) in this docker image follow this command. (Spacial thanks @aruelo for instrcution in issue #17)
docker run --privileged -v /dev/bus/usb:/dev/bus/usb -P -v $(pwd):/ionicapp kusumoto/docker-ionic-android-sdk /opt/android-sdk/platform-tools/adb devices