Setting up a development environment for Chef and Docker

In this tutorial we’re going to setup a dev environment for testing Chef recipes setting up Docker environments.

VirtualBox configuration


The first point consist in installing VirtualBox: my computer is working on OSX, I don’t wanted to change my OS to start working with Docker (Chef Docker provisioning is far more easy on Linux).
So I downloaded and installed the VirtualBox dog and a Fedora 20 iso.
Once Virtualbox was installed, I configured a new VB image with these settings:

  • General setting
  • Apply bidirectional copy/paste and Dnd
    System settings

  • MotherBoard settings
  • 4 gig of ram
    Start order to HDD then DVD
    ICH9 chipset
    Multitouch USB keypad
    IO-APIC and UTC enabled

  • Processors
  • 4 at 100%
    VT-x/pagination OK

  • Display
  • 128m of video with 3D acceleration

  • Drives
  • A DVD with the Fedora iso

  • Shared folders
  • One pointing on one of my host machine (to easily share files)
    20 Gig of hard drive in vdi format

Then started the VM and installed Fedora with default settings
Once The distro installed, I’d to change my keyboard layout in the preferences (choosing Francais(mac)).

Virtualbox requires client addition to work well, and its not so easy to find how to install it on Fedora.
At First, you’ve to update your packages (sudo yum update)
Then you’ve to install these packages:

yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms

Finally, click on the ‘peripheral menu’ then install guests additions’.

Chef and Docker installation


Then, you’ve to install docker:

yum install docker-io

and ChefDK (‘cause it’s cool!)
Then, you’ve to install the bridge between both:

 yum install gem; chef gem install knife-container

IDE


As I can’t stand Aptana anymore, I bought Rubymine with Darkula theme for about 100$ (I’m a programmer so I can afford it).

Make a private Docker index for testing


Now I’m going to setup a private docker image repo (on my personal server) to test and tag my containers before releasing them on docker.io. I was really helped by the serie on docker from french site developpez.com

docker pull registry; docker run -d -i --name registyDocker -p 5000:5000 -m 512m registry

That’s all (I just have to make a redirection on my apache and chkconfig docker and docker run config)!

Coding


I’m now ready to follow the Chef-docker tutorial: http://www.getchef.com/blog/2014/07/15/release-chef-container-0-2-0-beta/?mkt_tok=3RkMMJWWfF9wsRonuq%2FKZKXonjHpfsX96OUvX7Hr08Yy0EZ5VunJEUWy2ocHRNQ%2FcOedCQkZHblFnV4NT62jWqINqKMF

Share Button

One Comment

  • Elouise commented on May 22, 2016 Reply

    Thanks guys, I just about lost it lokoing for this.

Leave a Reply

Your email address will not be published. Required fields are marked *