Friday, 31 July 2015

Running Android apps in Docker using Googles ARC Welder

Firstly what is ARC Welder ?

It's a App runtime that allows you to run Android Apps in Chrome.  It is still in beta but looks really promising.  More details here : https://developer.chrome.com/apps/getstarted_arc

Installing the ARC Welder app is simple.  Just search the Chrome Webstore and add it to the browser.  Within minutes you can import a *.apk file for your favorite app and start playing about with it.  Cool.

There is a limitation though.  You can only load one Android app at a time.  Docker to the rescue. You can install Chrome and ARC Welder inside a container.  Each container can then be used for different Android Apps.

This may be handy for developers or QA folk who wish to run multiple versions of an app.

We also get the other benefits of Docker :

  1. Each app is isolated
  2. No modification needed on your host
  3. Easy to scale 
There are lots of ways to run Android apps for debugging purposes but this is the simplest I've come across.

To try this out you can run : 

docker run -it --net host --cpuset-cpus 0 --memory 512mb -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY -v $HOME/Downloads:/root/Downloads --device /dev/snd --name arcwelder thshaw/arc-welder

You can easily start multiple arc-welder containers, one for each app  :

 docker run -it --net host --cpuset-cpus 0 --memory 512mb -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY -v $HOME/Downloads:/root/Downloads --device /dev/snd --name instagram thshaw/arc-welder

docker run -it --net host --cpuset-cpus 0 --memory 512mb -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY -v $HOME/Downloads:/root/Downloads --device /dev/snd --name evernote thshaw/arc-welder

docker run -it --net host --cpuset-cpus 0 --memory 512mb -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY -v $HOME/Downloads:/root/Downloads --device /dev/snd --name angrybirds thshaw/arc-welder


More details can be found here : 

 

Docker Hub : https://registry.hub.docker.com/u/thshaw/arc-welder/

 

Github : https://github.com/tommyoshaw/arc-welder

 

Demo : Multiple Android Apps in containers
 

Demo : Angry Birds running on ARC Welder in Docker

video



Saturday, 25 July 2015

Dockerizing Evernote

Running Evernote in Docker using wine

There are a number of alternatives to accessing Evernote on Linux like Nevernote, Geeknote and Everpad.
As a long time user of Evernote and a Docker enthusiast it made sense to combine the two.
Disclaimer : I am not a power user of Evernote so people may find issues with webcam and sound functionality.

Usage :

docker run -d -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY –name evernote thshaw/evernote
** If you copy and paste the above please be sure to replace the -name with --name **
The first time this runs it will run the Evernote setup. Just login and the sync will start.
To stop the container :
docker stop evernote
To start the container :
docker start evernote

Versions
Ubuntu : 14:04

Evernote : 5.8.13

The Evernote image is built using : https://registry.hub.docker.com/u/thshaw/evernote/dockerfile/
Wine : 1.7.4