Firefox OS/Performance/Using Docker to Ease Debugging Firefox OS

From MozillaWiki
Jump to: navigation, search


  1. Set up private Docker Registry. (Or better yet, put them on the global, public docker registry?)
  2. Configure a Docker image for building B2G from source.
    1. Will contain the android SDK, the correct toolchain, and environment variables for building B2G from source.
  3. Create a VirtualBox image with the vagrant docker provisioner installed and configured to provision the latest docker image and start it on boot.
  4. Documentation
    1. Write docs for Windows/Mac users on running the VirtualBox image to use the Docker images.
    2. Write docs for Linux users on running docker images.
    3. Update bisection doc on how to grab the right docker image and flash a phone with the results.
  5. Automation
    1. Create a Jenkin's task to drive the docker daemon to update code, do the build, and snapshot the docker image into the registry?
    2. Investigate using amazon elastic beanstalk to scale docker image creation to one snapshot per commit?

Identify Registry to Store Docker Images

Private Registry

If we go with a private registry, this process is already documented in several places: [1] [2]

The only upside of a private registry is branding and the possibility of access control for private, security/prototype related debugging/patching of Firefox OS.

Public Registry

If we store docker images in the public registry then everybody in the Firefox OS community will have access to them. This would be really helpful for getting developers up to speed in a minimum amount of time.

I think for doing a docker image per commit, we should just use the public registry.

Dockerfile for a B2G Build Image

Here's is the Dockerfile for a B2G build image:

from ubuntu
# get 4.6 gnu toolchain
# get android sdk
# get git, ctags, cscope, vim, emacs, and everything needed to run cleopatra web app locally.
# get B2G repo

Create VirtualBox Image with Vagrant Provisioner

To ease the transition for Windows and Mac OS X users, we will build a VirtualBox image with the Vagrant Provisioner installed and configured to pull the latest B2G building docker image and start it on boot. This is documented here: [3]


Windows/Mac Using VirtualBox Image

Linux Using Docker Directly

Future: Scaling

There is potential that with a transition to Docker that we would be able to scale to one-build-per-check-in by deploying the docker images to a cloud computing service like Amazon's Elastic Beanstalk. Amazon recently announce that they would support deploying Docker images to AEB. The documentation is here: [4]