Skip to content

Docker Compose based Jenkins Operations Center by CloudBees environment.

Notifications You must be signed in to change notification settings

neilhudson/docker-compose-joc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

docker-compose-joc

Docker Compose based CloudBees Jenkins Operations Center environment.

Uses Docker Machine and Docker Compose to build a Jenkins Operations Center by CloudBees environment using Docker containers.

Mostly specific to Mac OS X but should work on Windows and Linux as well.

####Base includes:

###Instructions

  • install Docker Toolbox
    • This will install VirtualBox, Docker Machine, and Docker Compose (and some other stuff I don't really care about ;)
  • create a Docker Machine and add bip and dns docker daemon default options (I use cjoc as {machine_name})
    • docker-machine create --driver=virtualbox --virtualbox-memory=4096 {machine_name}
    • set env for newly created machine: eval "$(docker-machine env)"
    • ssh into machine: docker-machine ssh {machine_name}
    • sudo vi /var/lib/boot2docker/profile
    • append to EXTRA_ARGS and save: -bip=172.17.42.1/24 -dns 172.17.42.1 -dns 8.8.8.8
    • update the VirtualBox network adapter (vboxnet - number may vary) Promiscuous Mode to Allow All
  • replace vboxfs /Users share with nfs
    • Create NFS share on Mac OS X side:
      • create exports file: sudo vi /etc/exports with contents (IP used here is your docker-machine ip {machine_name}): /Users 192.168.99.100 -alldirs -mapall={your_username}
      • restart nfsd: sudo nfsd restart
    • Setup Docker Machine nfs:
      • Get IP of you VBox for the Docker host you are updating: VBoxManage showvminfo {machine_name} --machinereadable | grep hostonlyadapter
      • Run the following command to get the IPAddress for the VBox Network Adapter that matches the name from above: VBoxManage list hostonlyifs
      • Add a bootlocal script to your Docker Machine to start the NFS service on boot:
        • sudo vi /var/lib/boot2docker/bootlocal.sh

          #/bin/bash
          sudo umount /Users
          sudo /usr/local/etc/init.d/nfs-client start
          sudo mount -t nfs -o noacl,async 192.168.99.1:/Users /Users
          
      • Make the bootlocal.sh file executable: sudo chmod +x /var/lib/boot2docker/bootlocal.sh
      • exit ssh and restart Docker Machine: docker-machine restart
  • Route traffic from Mac OS X to Docker Machine VM IP: sudo route -n add -net 172.17.0.0 `docker-machine ip {machine_name}`
  • Configure OS X to use dnsdock DNS by creating the file /etc/resolver/docker with content of nameserver 172.17.42.1
  • Clone this repo anywhere under your /Users directory
  • If you would like to store your Jenkins HOME directory somewhere else you need to update the docker-compose.yml file:
    • Update data under dnsdock -> volumes to point to where you want your Jenkins HOME directory. NOTE: You could have several different directories configured for different demos and just change this to point to the demo you want to run.

###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
  • make sure you are able to ping the docker-machine ip {machine_name} - 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 your boot2docker ip - sudo route -n get 172.17.42.1
  • You may have to flush DNS cache - on Yosemite use: sudo discoveryutil mdnsflushcache
  • You may want to verify that you are using nfs instead of vboxfs for the /Users mount:
    • docker-machine ssh {machine_name}
    • mount
    • Look for the /Users mount and make sure it is using nfs

About

Docker Compose based Jenkins Operations Center by CloudBees environment.

Resources

Stars

Watchers

Forks

Packages

No packages published