Search code examples
dockerchef-infratest-kitchen

Kitchen and Kitchen-docker


I am trying to use kitchen-docker driver on a GNU/Linux machine. I have installed the kitchen-docker gem using chef gem install command.

This is an extract of my .kitchen.yml file:

---
driver:
  name: docker

provisioner:
  name: chef_zero

verifier:
  name: inspec

platforms:
  - name: centos-7.2
    driver_config:
      image: centos:7.2
      platform: centos

suites:
  - name: zaz
    run_list:
      - recipe[foo::bar]
...
...

I have Docker installed on it's latest version using Docker repositories for Centos. The service is running and Docker is in my path. However when I try to run a simple kitchen list using that .kitchen.yml I get this error:

[FakeyMcFakeFace@workstation foo]$ kitchen list
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::UserError
>>>>>> Message: You must first install the Docker CLI tool http://www.docker.io/gettingstarted/
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

Why is docker not being recognized by Kitchen? If I run the diagnose -all option I just see it is failing on the dependencies check:

backtrace:
- "/home/FakeyMcFakeFace/.chefdk/gem/ruby/2.3.0/gems/kitchen-docker-2.6.0/lib/kitchen/driver/docker.rb:93:in
  `rescue in verify_dependencies'"

What am I missing here?


Solution

  • To copy down from the comments, kitchen-docker requires passwordless sudo (if using sudo) right now, the error message is misleading