kitchen-docker: kitchen-docker does not properly detect Docker CLI tool on Ubuntu 14.04

The Docker CLI tool is called docker.io in the new Ubuntu 14.04 Docker package. When I try using the kitchen-docker plugin on Ubuntu 14.04, I get the following error because it is looking for docker instead of docker.io:

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

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 33 (3 by maintainers)

Most upvoted comments

@PaulTurner-awin @echohack try using

driver:
  name: docker
  use_sudo: false

Obviously it only works if you don’t need sudo to run the docker command.

@marzzz21 That’s because by default on Ubuntu installation, docker is run under sudo until you add your user to docker group.

However, kitchen doesn’t know that, hence by default, to use docker, kitchen tries to run docker as sudo. Now if you don’t run kitchen as sudo(like sudo kitchen list), then it cannot run docker as sudo, hence it throws an error.

When you put use_sudo:false, then kitchen tries to run docker without sudo and if you have configured dokcer to run with your user, kitchen will run just fine!

socket is the full socket, not just the port

---
driver: docker
  socket: tcp://localhost:2375 (depends on how/where you are connecting to)
  binary: docker.exe
  use_sudo: false

....

@baylisscg Thank you! Seems undocumented and worth documenting…

Well, over one error and into another. I suppose I don’t know enough about docker to really debug this at the time, but it seems that Boot2Docker on Mac doesn’t bind to the right place by default?..

bash-3.2$ kitchen converge
-----> Starting Kitchen (v1.2.2.dev)
-----> Creating <default-ubuntu-1204>...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #create action: [Expected process to exit with [0], but received '1'
---- Begin output of docker -H unix:///var/run/docker.sock build - ----
STDOUT: 
STDERR: 2014/08/13 08:44:38 Post http:///var/run/docker.sock/build?rm=1&t=: dial unix /var/run/docker.sock: no such file or directory
---- End output of docker -H unix:///var/run/docker.sock build - ----
Ran docker -H unix:///var/run/docker.sock build - returned 1]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration