OSX w/ kitchen-docker + an ubuntu vm = <3 faster tests <3
This Vagrantfile launches an ephemeral vm that exposes a Docker api capable of running Chef test-kitchen kitchens directly from OSX via kitchen-docker.
- VirtualBox or VMware Fusion + Vagrant VMware connector
- Vagrant
- vagrant-omnibus
- vagrant-berkshelf
- Docker CLI installed on OSX
Pull down a binary or build your own on OSX with Go. Either way the Docker CLI needs to be in your path on the OSX side.
$ go get github.com/dotcloud/docker
$ cd $GOPATH/src/github.com/dotcloud/docker/
$ git checkout v0.6.6
$ cd docker && go install
$ $GOPATH/bin/docker
- The Docker versions must match between host & guest or this will not work.
- kitchen-docker expects Docker v0.6.6 at this point. Using an earlier version breaks kitchen operations.
- The Docker daemon does not run on OSX. The CLI is used for communication.
- If you get
clang
errors compiling Docker from source, overrideCC
withgcc-4.2
(requires abrew install apple-gcc42
).
bundle install
vagrant up
---
driver_plugin: docker
driver_config:
use_sudo: false
socket: tcp://192.168.101.101:4242
require_chef_omnibus: true
platforms:
- name: ubuntu-12.04
driver_config:
image: ubuntu:12.04
platform: ubuntu
- name: centos-6.4
driver_config:
image: centos:6.4
platform: centos
kitchen create
<-- Magic.
This repo is heavily inspired by @portertech's efforts.