├── Dockerfile ├── demo-video.gif └── readme.md /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kallikrein/cordova:5.1.1 2 | 3 | MAINTAINER Thomas Charlat 4 | RUN \ 5 | apt-get update && \ 6 | apt-get install -y lib32stdc++6 lib32z1 lib32ncurses5 lib32bz2-1.0 g++ ant python make 7 | 8 | RUN curl -sL https://deb.nodesource.com/setup_iojs_2.x | sudo bash - && sudo apt-get install -y iojs 9 | 10 | # download and extract android sdk 11 | RUN curl http://dl.google.com/android/android-sdk_r24.2-linux.tgz | tar xz -C /usr/local/ 12 | ENV ANDROID_HOME /usr/local/android-sdk-linux 13 | ENV PATH $PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools 14 | 15 | # update and accept licences 16 | RUN ( sleep 5 && while [ 1 ]; do sleep 1; echo y; done ) | /usr/local/android-sdk-linux/tools/android update sdk --no-ui -a --filter platform-tool,build-tools-22.0.1,android-22 17 | 18 | RUN npm install nativescript -g --unsafe-perm 19 | 20 | ENV GRADLE_USER_HOME /src/gradle 21 | VOLUME /src 22 | WORKDIR /src 23 | -------------------------------------------------------------------------------- /demo-video.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oren/docker-nativescript/11867603b7b990d3a7eb96cad56a0b7e140e1a1f/demo-video.gif -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Docker container for NativeScript development 2 | 3 | [![docker-badge](http://dockeri.co/image/oreng/nativescript)](https://registry.hub.docker.com/u/oreng/nativescript) 4 | 5 | ![demo-video](demo-video.gif) 6 | 7 | ## Content 8 | 9 | * [why](#why) 10 | * [Setup](#setup) 11 | * [New Project](#new-project) 12 | * [Useful commands](#useful-commands) 13 | * [References](#references) 14 | 15 | ## Why? 16 | I wanted to explore [NativeScript](https://www.nativescript.org) but didn't want to install and configure Java, Android SDK, Ant, etc. Life is too short so I created a Docker container with everything needed to run it. 17 | Here is the relevant blog post: http://oren.github.io/blog/nativescript.html 18 | 19 | ## Setup 20 | 21 | git clone git@github.com:oren/docker-nativescript.git 22 | cd docker-nativescript 23 | docker build -t nativescript . 24 | alias tns='docker run -it --rm --privileged -v /dev/bus/usb:/dev/bus/usb -v $PWD:/src nativescript tns' 25 | 26 | The alias command lets you use `tns` for running any command inside the nativescript container. 27 | 28 | ## New Project 29 | 30 | tns create hello 31 | cd hello 32 | tns platform add android 33 | tns run android 34 | 35 | That's it, your app should be on your phone! 36 | 37 | ## References 38 | 39 | The image is a modification of https://github.com/Kallikrein/dockerfiles/tree/master/android-cordova 40 | --------------------------------------------------------------------------------