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.