portertech/kitchen-docker — pull request #27 by adnichols (2013-11-30 00:51:59+00:00)
Title: Added support for docker-api gem as client

Removes requirement that cli tools be installed on host running test-kitchen. This also added a few additional options:

:ruby_client -- (true/false) select whether to use the docker-api as
your docker client (default false)

:read_timeout -- (int) Choose read timeout used by docker-api during
API operations. This originally defaulted to 60 seconds which was too low
for some Docker::Image.build() operations such as large RPM installs on the first
(uncached) run, bumped to a workable default and made configurable
through kitchen.yml should someone need it to be higher/lower

The port forwarding config code seems unnecessarily complex but the use of the API required substantially more logic around how ports are handled. Would love feedback on ways to improve it.

All options were compared against the CLI client to make sure things provided equivalent functionality.

Used the following basic .kitchen.local.yml to test & added options as necessary to test each:

```
---
driver_plugin: docker
driver_config:
ruby_client: true
privileged: false
socket: tcp://192.168.1.3:4242

platforms:
- name: centos-6.4
run_list:
- recipe[test-gem]
```

I tested ubuntu-12.04 as well but received the following error using both the docker-api gem and cli client:

```
-----> Converging ...
D Creating local sandbox in /var/folders/jt/2g9h3ddn00s6sf3rfbyxwv9rlr07l0/T/default-centos-64-sandbox-20131129-88876-khjd4c
Resolving cookbook dependencies with Berkshelf...
D Using Berksfile from /Users/anichols/projects/test-gem/Berksfile
[1] 88876 trace trap bundle exec kitchen converge --parallel --log-level=debug
````

I didn't dig into this further as behavior was consistent - assuming it's related to test-kitchen or docker themselves.