serverspec/specinfra — pull request #251 by rossbachp (2014-10-19 16:50:03+00:00)
Title: Docker exec

HI,

Andreas Schmidt and I describe a serverspec docker integration with nsenter at our infrabricks blog [GERMAN: Docker Container mit serverspec testen ](http://www.infrabricks… …
….de/blog/2014/09/10/docker-container-mit-serverspec-testen/).

This is the specinfra 2 patch:

Usage of this nsenter backend:
```ruby
require 'serverspec'

set :os, :arch => 'x86_64', :family => 'debian', :distro => 'debian', :release => 7
set :backend, :nsenter
set :docker_cid, "tomcat8"
set :nsenter_pid, nil

puts "#{Specinfra.configuration.docker_cid}"

describe package('wget') do
it { should be_installed }
end
```

or

```ruby
require 'serverspec'

set :os, :arch => 'x86_64', :family => 'debian', :distro => 'ubuntu', :release => 14
set :backend, :nsenter
set :nsenter_pid, `docker inspect -f '{{ .State.Pid }}' tomcat8`

puts "#{Specinfra.configuration.nsenter_pid}"

describe package('wget') do
it { should be_installed }
end
```

I detect problems with the specinfra auto os detection with ubuntu floatpoint release number `14.04`!

Regards
Peter