kitchen-docker: Can't run kitchen-docker with Docker for Mac
I have the new Docker for Mac installed and I can run docker just fine. When I run kitchen docker though I get the following error:
)-> kitchen converge --log-level=debug
-----> Starting Kitchen (v1.7.3)
D [kitchen::driver::docker command] BEGIN (sudo -E docker >> /dev/null 2>&1)
D [kitchen::driver::docker command] END (0m0.01s)
>>>>>> ------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
D ------Exception-------
D Class: Kitchen::UserError
D Message: You must first install the Docker CLI tool http://www.docker.io/gettingstarted/
D ---Nested Exception---
D Class: Kitchen::ShellOut::ShellCommandFailed
D Message: Expected process to exit with [0], but received '1'
---- Begin output of sudo -E docker >> /dev/null 2>&1 ----
STDOUT:
STDERR:
---- End output of sudo -E docker >> /dev/null 2>&1 ----
Ran sudo -E docker >> /dev/null 2>&1 returned 1
D ------Backtrace-------
D /Users/thiagoo/.chefdk/gem/ruby/2.1.0/gems/kitchen-docker-2.4.0/lib/kitchen/driver/docker.rb:78:in `rescue in verify_dependencies'
D /Users/thiagoo/.chefdk/gem/ruby/2.1.0/gems/kitchen-docker-2.4.0/lib/kitchen/driver/docker.rb:76:in `verify_dependencies'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.7.3/lib/kitchen/driver.rb:45:in `for_plugin'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.7.3/lib/kitchen/config.rb:230:in `new_driver'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.7.3/lib/kitchen/config.rb:243:in `new_instance'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.7.3/lib/kitchen/config.rb:139:in `block in build_instances'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.7.3/lib/kitchen/config.rb:138:in `map'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.7.3/lib/kitchen/config.rb:138:in `with_index'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.7.3/lib/kitchen/config.rb:138:in `build_instances'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.7.3/lib/kitchen/config.rb:114:in `instances'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.7.3/lib/kitchen/command.rb:115:in `filtered_instances'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.7.3/lib/kitchen/command.rb:145:in `parse_subcommand'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.7.3/lib/kitchen/command/action.rb:38:in `block in call'
D /opt/chefdk/embedded/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.7.3/lib/kitchen/command/action.rb:37:in `call'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.7.3/lib/kitchen/cli.rb:56:in `perform'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.7.3/lib/kitchen/cli.rb:180:in `block (2 levels) in <class:CLI>'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.7.3/lib/kitchen/cli.rb:321:in `invoke_task'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.7.3/bin/kitchen:13:in `block in <top (required)>'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.7.3/lib/kitchen/errors.rb:154:in `with_friendly_errors'
D /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.7.3/bin/kitchen:13:in `<top (required)>'
D /opt/chefdk/bin/kitchen:17:in `load'
D /opt/chefdk/bin/kitchen:17:in `<main>'
D ----------------------
)-> sudo -E docker >> /dev/null 2>&1
)-> echo $?
0
)->
About this issue
- Original URL
- State: open
- Created 8 years ago
- Reactions: 2
- Comments: 27 (2 by maintainers)
Commits related to this issue
- Make 'kitchen-docker' work in OSX. Reference: - https://github.com/test-kitchen/kitchen-docker/issues/207 - https://github.com/test-kitchen/kitchen-docker/issues/201 — committed to jvrplmlmn/ansible-st2 by jvrplmlmn 8 years ago
- Make 'kitchen-docker' work in OSX. Reference: - https://github.com/test-kitchen/kitchen-docker/issues/207 - https://github.com/test-kitchen/kitchen-docker/issues/201 — committed to jvrplmlmn/ansible-st2 by jvrplmlmn 8 years ago
- Make 'kitchen-docker' work in OSX. Reference: - https://github.com/test-kitchen/kitchen-docker/issues/207 - https://github.com/test-kitchen/kitchen-docker/issues/201 — committed to jvrplmlmn/ansible-st2 by jvrplmlmn 8 years ago
- Fix docker cli access for kitchen-docker See https://github.com/test-kitchen/kitchen-docker/issues/207 — committed to shortdudey123/chef-percona by shortdudey123 7 years ago
I tried the
use_sudo: falseworkaround from #201 and it works. 😄 … But it’s just a workaround. It should work whether or not I use sudo.So the work around steps are:
Just run
eval (docker-machine env default)on the shell. This is an issue with the Mac, not the driver. If you can’tdocker psthen the driver doesn’t stand a chanceOn OSX, I was able to get around this error permanently by:
I haven’t seen it since.
Not everyone can do this, because it’s highly destructive operation, but I suspect most can because they are using Docker purely for dev purposes on their workstation.
Ran into this issue today:
OSX 10.11.6 Docker version 1.12.1, build 6f9534c kitchen-docker 2.6.0
Had to add
use_sudo: falseto.kitchen.ymlto get it to work.@davidcpell You can also add
use_sudo: falseto your~/.kitchen/config.ymlin the driver section.This solution was mentioned on the PR referenced above, but never brought back here.
i don’t use docker-machine, though… i’m using the native docker for mac. no docker environment variables need to be set for it.
Is there anything I could do to help address this issue?
Or perhaps there is a different recommendation for using Test Kitchen with Docker on a Mac?
I’m blocked right now and I’m not sure how to proceed.
If I use this
use_sudo: falsework-around, I can make theClass: Kitchen::UserError Message: You must first install the Docker CLI tool...error go away, however, instead I get a failure like this onkitchen converge:which makes sense. When you run
kitchen login defaultas the kitchen user (not root) and runmkdir /tmp/kitchenyou get this same error, it’s because the provisioner now no longer has privileges to do this.How do I give the provisioner the permissions it needs when
use_sudo: false?My
.kitchen.yml