├── Dockerfile ├── README.md └── tools └── android-accept-licenses.sh /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:wheezy 2 | 3 | MAINTAINER garvin [dot] leclaire [at] gmail [dot] com 4 | 5 | # Install basics 6 | RUN apt-get update && \ 7 | apt-get install -y git wget curl && \ 8 | apt-get clean 9 | 10 | RUN curl -sL https://deb.nodesource.com/setup | bash - 11 | 12 | RUN apt-get update && \ 13 | apt-get install -y nodejs nodejs-legacy build-essential && \ 14 | ln -s /usr/bin/nodejs /usr/local/bin/node && \ 15 | apt-get clean 16 | 17 | 18 | COPY tools /opt/tools 19 | 20 | # Install npm packages 21 | RUN npm install -g cordova ionic 22 | RUN npm install -g grunt-cli 23 | RUN npm install -g gulp 24 | RUN npm install -g bower 25 | 26 | RUN ionic start ionic-demo sidemenu 27 | 28 | # Expose port: web (8100), livereload (35729) 29 | EXPOSE 8100 35729 30 | 31 | 32 | #ANDROID 33 | #JAVA 34 | 35 | # ENV DEBIAN_FRONTEND noninteractive 36 | RUN dpkg-reconfigure debconf -f Noninteractive 37 | 38 | # install python-software-properties (so you can do add-apt-repository) 39 | RUN apt-get update && apt-get install -y -q python-software-properties software-properties-common && apt-get clean 40 | 41 | # install oracle java from PPA 42 | # RUN add-apt-repository ppa:webupd8team/java -y 43 | RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections 44 | #echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections 45 | # RUN apt-get update && apt-get -y install oracle-java7-installer && apt-get clean 46 | 47 | RUN echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee /etc/apt/sources.list.d/webupd8team-java.list 48 | RUN echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list 49 | RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 50 | RUN apt-get update && \ 51 | apt-get install -y oracle-java8-installer && \ 52 | apt-get clean 53 | 54 | #ANDROID STUFF 55 | RUN dpkg --add-architecture i386 && apt-get update && apt-get install -y --force-yes expect ant wget libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1 qemu-kvm kmod && apt-get clean 56 | 57 | # Install Android SDK 58 | RUN cd /opt && wget --output-document=android-sdk.tgz --quiet http://dl.google.com/android/android-sdk_r24.0.2-linux.tgz && tar xzf android-sdk.tgz && rm -f android-sdk.tgz 59 | 60 | # Setup environment 61 | ENV ANDROID_HOME /opt/android-sdk-linux 62 | ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools 63 | 64 | # Install sdk elements 65 | ENV PATH ${PATH}:/opt/tools 66 | 67 | RUN echo ANDROID_HOME="${ANDROID_HOME}" >> /etc/environment 68 | 69 | RUN ["/opt/tools/android-accept-licenses.sh", "android update sdk --all --no-ui --filter platform-tools,tools,build-tools-21.1.2,android-19,addon-google_apis_x86-google-19,extra-android-support,extra-android-m2repository,extra-google-m2repository,sys-img-x86-android-21"] 70 | 71 | 72 | WORKDIR ionic-demo 73 | CMD ["ionic", "serve", "--all", "--port", "8100", "--livereload-port", "35729"] 74 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Docker Hub](https://img.shields.io/badge/docker-ready-blue.svg)](https://registry.hub.docker.com/u/gleclaire/ionic-framework/) 2 | 3 | ionic-framework 4 | ============================= 5 | 6 | ![Ionic](http://ionicframework.com/img/ionic-logo-blue.svg) 7 | 8 | Ionic-framework is a ready-to-go hybrid deveopment environment for building mobile apps with Ionic, Cordova, and Android. 9 | This is Docker image based on the Vagrant ionic-box (from [driftyco/ionic-box](https://github.com/driftyco/ionic-box)) to build the ionic-framework. 10 | 11 | Requirements 12 | ================= 13 | 14 | * [Docker](https://www.docker.com/) 15 | 16 | 17 | Usage : ionic-framework 18 | ================= 19 | 20 | sudo docker run -it --rm --name ionic-framework -p 8100:8100 -p 35729:35729 gleclaire/ionic-framework 21 | 22 | * App is running on http://$DOCKER_HOST:8100 which by default is [http://192.168.59.103/:8100](http://192.168.59.103/:8100) 23 | 24 | If you have your own ionic sources, you can launch it with: 25 | 26 | sudo docker run -ti -p 8100:8100 -p 35729:35729 -v /path/to/your/ionic-project/:/myApp gleclaire/ionic-framework /bin/bash 27 | 28 | Enable USB for the container 29 | 30 | sudo docker run -ti --rm -p 8100:8100 -p 35729:35729 --privileged -v /dev/bus/usb:/dev/bus/usb -v \$PWD:/myApp gleclaire/ionic-framework adb list 31 | 32 | -------------------------------------------------------------------------------- /tools/android-accept-licenses.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect -f 2 | 3 | set timeout 1800 4 | set cmd [lindex $argv 0] 5 | set licenses [lindex $argv 1] 6 | 7 | spawn {*}$cmd 8 | expect { 9 | "Do you accept the license '*'*" { 10 | exp_send "y\r" 11 | exp_continue 12 | } 13 | eof 14 | } 15 | --------------------------------------------------------------------------------