-1

I'm trying to kick off testing using kitchen-docker.

kitchen-docker gem was installed through bundler already.

.kitchen.yml looks like this

---
driver:
  name: docker
  network:
  - ["private_network", { ip: "192.168.33.10" }]

provisioner:
  name: chef_solo

platforms:
  - name: ubuntu-14.04

suites:
  - name: default
    run_list:
      - recipe[homepage-test::default]
    attributes:

"bundle exec kitchen test" command ends up with the error below

-----> Starting Kitchen (v1.4.2)
-----> Creating <default-ubuntu-1204>...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #create action: [undefined method `create' for Tempfile:Class]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

I guess this doesn't work somehow because it fails to create the instance, but I have no idea how to approach this.

################### UPDATED #####################

There is an issue on github https://github.com/portertech/kitchen-docker/issues/148

That was exactly the some error as I used to have. And then I updated ruby 2.0.0 to 2.2.3 (the latest stable version) with rbenv.

And another error comes up,

I'm still stuck and still confused why this doesn't work, so I checked the log file and coming out the error message like this

STDERR: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.20/build?cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile-kitchen-20151030-31260-10xmvl2&memory=0&memswap=0&rm=1&t=&ulimits=null: dial unix /var/run/docker.sock: connect: no such file or directory.
* Are you trying to connect to a TLS-enabled daemon without TLS?
* Is your docker daemon up and running?
Toshi
  • 6,012
  • 8
  • 35
  • 58
  • 1
    Any details on the results of those recomendation ? " >>>>>> Please see .kitchen/logs/kitchen.log for more details >>>>>> Also try running `kitchen diagnose --all` for configuration". We can't do divination and guess magically what's going wrong with your installation – Tensibai Oct 29 '15 at 08:49
  • @Tensibai Thanks for the suggestion, I just updated. – Toshi Oct 30 '15 at 10:15
  • Update your chef-dk release, avoid messing with rbenv/rvm to run chef, it's just a pain at end. – Tensibai Oct 30 '15 at 10:17
  • oh well i don't use chef-dk for this project because i was just asked to test some cookbook, so should i update ruby with homebrew not using rbenv/rvm? – Toshi Oct 30 '15 at 10:33
  • 1
    You should use a coherent chef package in my opinion. [Chef-dk](https://docs.chef.io/install_dk.html) comes with all lib and gem in a coherent way to write and test cookbooks. As far as I know there's always hiccups out of omnibus install – Tensibai Oct 30 '15 at 10:37
  • Yeah that makes sense. Thanks! – Toshi Oct 30 '15 at 10:42
  • That last error is just that your user can't talk to the docker daemon. Do docker commands work locally? Like `docker ps -a`? – Martin Nov 06 '15 at 17:39
  • in your kitchen file, have you got the socket defined as the following? socket: unix:///var/run/docker.sock That it starts off with http and then looks to the socket makes me think not – Simon Feb 05 '17 at 11:51

1 Answers1

0

This message:

STDERR: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.20/build?cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile-kitchen-20151030-31260-10xmvl2&memory=0&memswap=0&rm=1&t=&ulimits=null: dial unix /var/run/docker.sock: connect: no such file or directory.
* Are you trying to connect to a TLS-enabled daemon without TLS?
* Is your docker daemon up and running?

Means that your docker daemon is not running. Try ?

service docker start

Check the existence /var/run/docker.sock after.

Rico
  • 58,485
  • 12
  • 111
  • 141