2
I'm using a linux desktop with an 3.2 kernel (Ubuntu 12.04) and would like to test out using vagrants docker provider/provisioning.
So I make a Vagrantfile in root:
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "app" do |v|
v.vm.provider "docker" do |d|
d.cmd = ["/sbin/my_init", "--enable-insecure-key"]
d.image = "phusion/baseimage"
d.has_ssh = true
d.vagrant_vagrantfile = "./docker/Vagrantfile"
end
v.ssh.username = "root"
v.ssh.private_key_path = "phusion.key"
end
end
The containers vagrantfile (./docker/Vagrantfile) looks like this:
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.provision "docker"
config.vm.provision "shell", inline:
"ps aux |grep 'sshd:' | awk '{print $2}' | xargs kill"
end
(actually these files are from the blog post)
Trouble is when I do a
$ vagrant up --provider=docker
I get the following error:
Bringing machine 'app' up with 'docker' provider... The executable 'docker' Vagrant is trying to run was not found in the PATH variable. This is an error. Please verify this software is installed and on the path.
I rather expected that it would launch a virtualbox instance with ./docker/Vagrantfile, the precise64 image provisioned for docker, and that it wouldn't be necessary to have a locally installed docker (which is not possible because I'm on 3.2)?
If someone can reproduce this or spot an obvious error, I would appreciate a comment or answer. Thank you!
Edited: The example above is a bit more complicated than needed to check out the problem. I can't really use the docker provider at all so I suspect a vagrant bug unless there is something obviously wrong here.
A simpler way to reproduce using this Vagrantfile:
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "app" do |v|
v.vm.provider "docker" do |d|
d.cmd = ["/sbin/my_init", "--enable-insecure-key"]
d.image = "phusion/baseimage"
d.has_ssh = true
end
v.ssh.username = "root"
v.ssh.private_key_path = "phusion.key"
end
end
When I try to use it:
$ uname -a
Linux ubuntu1204 3.2.0-64-generic #97-Ubuntu SMP Wed Jun 4 22:04:21 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ vagrant up --provider=docker
Bringing machine 'app' up with 'docker' provider...
The executable 'docker' Vagrant is trying to run was not
found in the PATH variable. This is an error. Please verify
this software is installed and on the path.
Hi, thanks for answering, but it's not relevant for my question. My problem is that it doesn't try to spin up any machine at all. It just complains that I'm missing docker on local machine. I'm thinking it could be a bug in vagrant. – grm – 2014-06-13T13:37:32.227
Ah, gotcha. Your issue is that Vagrant won't use the proxy VM by default on Linux as you can just install and run docker directly in it. I edited the answer accordingly. – tmatilai – 2014-06-14T21:43:00.410