Development in Docker
Overview
This page describes how to develop, build and test Ambari on Docker.
In order to build Ambari, there are a quite few steps to execute and it is a bit cumbersome. You can build an environment in Docker and are good to go!
This is NOT meant for running production level Ambari in Docker (though you can run Ambari and deploy Hadoop in a single Docker container for testing purpose)
(This is not only about Jenkins slaves but think it is your laptop)
First, we will make a Docker image that has all third party libraries Ambari requires.
Second, prepare your code on Docker host machine. It can be trunk or a branch, or your developing code or with a patch applied. Note that your code does not reside inside of Docker container, but on the Docker host and we link it by Docker volume (like mount)
And you are ready to go!
Source code
This code has been migrated to Ambari trunk.
https://github.com/apache/ambari/tree/trunk/dev-support/docker
Requirements
There are a few system requirements if you want to play with this document.
Create Docker Image
First thing first, we have to build an Docker image for this solution. This will setup libraries including ones from yum and maven dependencies. In my environment (Centos 6.5 VM with 8GB and 4CPUs) takes 40mins. Good news is this is one time.
git clone https://github.com/apache/ambari.git cd ambari docker build -t ambari/build ./dev-support/docker/docker
Unit Test
For example our unit test Jenkins job on trunk runs on Docker.
Deploy Hadoop
Run only ambari-server
Run only ambari-server and ambari-agent