Uses Docker Compose to build a Jenkins Operations Center high availability environment using Docker containers.
Currently specific to Mac OS X.
####Base includes:
- dnsdock providing DNS for docker containers and exposed to Mac OS X
- HA Jenkins Operation Center proxied via HAProxy
- HA Client Master proxied via HAProxy
- 2 shared slaves
###Instructions
- install boot2docker
- install Docker Compose
- run boot2docker and add
bip
anddns
docker daemon default optionsboot2docker ssh
vi /var/lib/boot2docker/profile
- add the following line and save:
EXTRA_ARGS="-bip=172.17.42.1/24 -dns 172.17.42.1 -dns 8.8.8.8"
- exit ssh and restart boot2docker:
boot2docker restart
- update the VirtualBox network adapter (vboxnet - number may vary) Promiscuous Mode to Allow All
- Route traffic from Mac OS X to boot2docker VM IP:
sudo route -n add -net 172.17.0.0 <BOOT2DOCKER_IP>
- BOOT2DOCKER_IP retrieved via
boot2docker ip
- BOOT2DOCKER_IP retrieved via
- Configure OS X to use dnsdock DNS by creating the file
/etc/resolver/docker
with content ofnameserver 172.17.42.1
- clone this repo somewhere under the
/Users
directory - Update the
docker-compose.yml
file:- Update
/Users/kmadel/dev/CloudBees/docker/cbdemo
under dnsdock -> volumes to point to where you cloned this repo. NOTE: You could have several different directories configured for different demos and just change this to point to the demo you want to run. - Update the
jocproxy
andapiteamproxy
services' volumes to point to the respective haproxy subfolders where you cloned this repo
- Update
- from your boot2docker shell, run
docker-compose up -d
and after a few minutes (maybe a bit longer) you should have:- HA JOC at http://joc.bee.docker (check http://joc.bee.docker:9000 for HAProxy statistics)
- HA Jenkins Enterprise at http://apiteam.bee.docker
###Gotchas If you are no longer able to access docker container hosts via Mac OS X:
- check that the route is correct:
sudo route -n add -net 172.17.0.0 192.168.59.103
- Gateway should be
boot2docker ip
- Gateway should be
- make sure you are able to ping the
boot2docker ip
- ex (the IP may vary):ping 192.168.59.103
from Mac OS X - check to see that the
ip route
you added, still points to yourboot2docker ip
-sudo route -n get 172.17.42.1
- You may have to flush DNS cache - on Yosemite use:
sudo discoveryutil mdnsflushcache
###Create a New Demo
- You should probably fork this repo, but not absolutely necessary
- checkout a new branch:
git checkout -b workflow-demo master
- update
docker-compose.yml
to include whatever additional Docker containers you may need - dnsdock will automatically expose them to Mac OS X, so you could for example create a Jetty container with the environment parametersDNSDOCK_NAME=staging
and aDNSDOCK_IMAGE=jetty
and if you didn't change the dnsdock defautls, your new jetty container will be available at http://staging.jettty.docker - You may keep the base Jenkins joc and apiteam or start completelly from scratch by removing the
var
directory. At start up, Jenkins Enterprise and JOC will rebuild the respective working directories from scracth - so this may take some time.
You can have as many branches for different demo scenarios that you can think of...
More details to come...