DEV Community

Grégoire
Grégoire

Posted on • Originally published at gkdv.net

3

A docker image for your cordova and electron projects

Read the original article on GKDV

Each time I need to do a little personal android project (with a light angularjs), I have to remember how to configure android environement, cordova packages, etc.


cordova and electron docker image github template

And recently, I need to generate an electron app. However, cordova and electron use static html rendering logic: how to make it easier?

Using docker

I created a template repository on github: electron-docker-project, which handles android and electron build, and can serve html files using nginx (because modern browsers deny ajax call on local environment). It’s really simple to use, after you based your repository on this template:

Install

$ git clone git@github.com:gpenverne/electron-docker-project.git  
$ cd electron-docker-project  
$ make build # Build the docker image  
$ make install # Install dependencies  

Run - electron gui

$ make gui # Launch the electron gui  

Generate an android APK (cordova)

$ make android # Generate the android folders  
$ make package # Build android apk (and electron packages!)  

Serve static html ui (nginx)

$ make serve-html # Will helpfull to dev  

This docker image embed electron and android cordova dependencies: Now, you just have to edit the config.xml file to set the android app’s name, et voilà!




cordova and electron docker image github template

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay