In this tutorial we’re going to setup a dev environment for testing Chef recipes setting up Docker environments.
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
- MotherBoard settings
- 128m of video with 3D acceleration
- Shared folders
Apply bidirectional copy/paste and Dnd
4 gig of ram
Start order to HDD then DVD
Multitouch USB keypad
IO-APIC and UTC enabled
4 at 100%
A DVD with the Fedora iso
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
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)!
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