Centos with node, java JDK, and android SDK installed for Android development.
This image was built for development via Mac, these steps are intended for that use case.
Local Development Usage:
Run the image from the location of the project code (ex. /home/username/Projects/projectName)
- docker run -i -t -v <absoluteProjectPath>:/webapp -p 8080:8100 bwilkin/ionic-dev bash
Run the application
- cd /webapp/<project> - npm install - ionic serve (when prompted where to run from, select the ip address rather than localhost)
The application will be accessible at http://localhost:8080 on the host machine.
Update the Android SDK in the docker container
- cd /opt/android-sdk/tools - android list sdk --all - android update sdk -u -a -t <packages for the desired SDK> (ex: 1,2,5,28,102,137,138,144 for SDK version 24)
Build the android apk
- cd /webapp/<project> - npm install - ionic add platform android - ionic build android
Copy the apk to the host machine
- docker cp <containerId>:/webapp/<projectName>/platforms/android/build/outputs/apk/android-debug.apk .
Start an android emulator
Drag and drop the apk into the emulator
- Get emulator working, from the docker container