├── Dockerfile ├── README.md ├── Vagrantfile └── bootstrap.sh /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM phusion/baseimage:0.9.12 2 | MAINTAINER Nicolas Pace 3 | 4 | # Set correct environment variables. 5 | ENV HOME /root 6 | ENV ANDROID_SDK_FILENAME android-sdk_r23.0.2-linux.tgz 7 | ENV ANDROID_SDK http://dl.google.com/android/$ANDROID_SDK_FILENAME 8 | 9 | # Regenerate SSH host keys. baseimage-docker does not contain any, so you 10 | # have to do that yourself. You may also comment out this instruction; the 11 | # init system will auto-generate one during boot. 12 | RUN /etc/my_init.d/00_regen_ssh_host_keys.sh 13 | 14 | # Use baseimage-docker's init system. 15 | CMD ["/sbin/my_init"] 16 | 17 | 18 | # Install Oracle Java 19 | RUN apt-get -y install software-properties-common 20 | RUN add-apt-repository ppa:webupd8team/java 21 | RUN apt-get update 22 | RUN echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 boolean true" | debconf-set-selections 23 | RUN apt-get -y install oracle-java7-installer 24 | 25 | # ...put your own build instructions here... 26 | # RUN apt-get update 27 | 28 | ## Create a user for the web app. 29 | RUN addgroup --gid 9999 app 30 | RUN adduser --uid 9999 --disabled-password --gid 9999 --gecos "Application" app 31 | # RUN echo app | passwd app --stdin 32 | RUN echo "app:app" | chpasswd 33 | 34 | # Android Install 35 | # adb dependencies 36 | # 37 | RUN apt-get install -y ant expect wget && \ 38 | apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 39 | 40 | RUN cd /opt && \ 41 | wget $ANDROID_SDK && \ 42 | tar -xzvf $ANDROID_SDK_FILENAME && \ 43 | export ANDROID_HOME=/opt/android-sdk-linux && \ 44 | export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools && \ 45 | chgrp -R users /opt/android-sdk-linux && chmod -R 0775 /opt/android-sdk-linux && \ 46 | rm $ANDROID_SDK_FILENAME 47 | 48 | RUN echo -e "export ANDROID_HOME=/opt/android-sdk-linux \nexport PATH=\$PATH:/opt/android-sdk-linux/tools:/opt/android-sdk-linux/platform-tools" >> /etc/profile.d/android.sh 49 | 50 | RUN expect -c ' \ 51 | set timeout -1;\ 52 | spawn /opt/android-sdk-linux/tools/android update sdk -u --all --filter platform-tool,android-19,build-tools-19.1.0 \ 53 | expect { \ 54 | "Do you accept the license" { exp_send "y\r" ; exp_continue } \ 55 | eof\ 56 | }\ 57 | ' 58 | 59 | # # Ionic Install 60 | # # ionic dependencies 61 | # RUN apt-get install -y nodejs npm git && \ 62 | # apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 63 | # 64 | # # So ubuntu doesn't freak out about nodejs path, which is just silly 65 | # RUN ln -s /usr/bin/nodejs /usr/bin/node 66 | # 67 | # RUN npm install -g cordova 68 | # RUN npm install -g ionic 69 | # 70 | # # Add USB Support 71 | # # usb dependencies 72 | # RUN apt-get install -y usbutils && \ 73 | # apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 74 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### Docker Installation 2 | 3 | To install, download and install [Docker](https://docker.com/) for your platform. 4 | 5 | Once Docker is installed, you can run a downloadable image from Docker Hub, or build your own. 6 | To download and use the Docker Hub image, you can run: 7 | 8 | ```bash 9 | $ CID=$(docker run -d nicopace/ionic-cordova-android-vagrant-) # This runs the Docker Image 10 | 11 | $ # And this gets you inside the Docker Image so you can use it 12 | $ IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $CID) 13 | $ ssh app@$IP # password: app 14 | ``` 15 | 16 | If you prefer to build your own image, download the latest release of this GitHub repo, and unzip it. `cd` into the unzipped folder and run: 17 | 18 | ```bash 19 | $ docker build --tag="username/ionicbox" --no-cache=false . 20 | ``` 21 | 22 | Then, you can run your own image, running the command specified before, changing the tag (in that case nicopace/ionic-cordova-android-vagrant-) with your own (in this case, username/ionicbox) 23 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! 5 | VAGRANTFILE_API_VERSION = "2" 6 | 7 | $init = <