Code Monkey home page Code Monkey logo

docker-cordova's Introduction

Docker container for Cordova development

docker-badge

demo-video

Content

Why?

I don't want to install and configure Java, Android SDK, Ant, cordova etc.. life is too short.

Setup

git clone [email protected]:oren/docker-cordova.git
cd docker-cordova
docker build -t cordova .
alias mine='sudo chown -R $USER'
alias drun='docker run -it --rm'
alias cordova='drun --privileged -v /dev/bus/usb:/dev/bus/usb -v $PWD:/src cordova cordova'

The alias command lets you use cordova for running any command inside the cordova container.

New Project

cordova create hello
cd hello
cordova platform add android
cordova build

Connect your android device to your laptop with a usb

cordova run android

That's it, your app should be on your phone!

Useful commands

List of attached devices

Make sure you see your phone in that list.

docker run --rm -i -v $(pwd):/workspace -w /workspace \
    --privileged -v /dev/bus/usb:/dev/bus/usb cordova adb devices

Run with different user

To ensure the container uses the same user id as the caller use the -u option and provide a writeable HOME directory to that user (change the alias if necessary!)

alias cordova='docker run --rm -i -u `id -u` -v $PWD:/src -e "HOME=/tmp" cordova cordova'

References

The image is based on https://github.com/Kallikrein/dockerfiles/tree/master/android-cordova~/projects/myAPP

docker-cordova's People

Contributors

ascheman avatar oren avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.