MrTambourineMan
MrTambourineMan

Reputation: 1045

Vagrant with docker provisioning

I am new to docker and vagrant. I installed vmbox and vagrant in my ubuntu 14.04 machine. I did "git clone https://github.com/dotcloud/docker.git" to get the docker repository. I have also added precise64 from vagrant successfully.

From docker directory i tried "vagrant up". But it told me to do "vagrant init" first. So I did "vagrant init precise64". After doing "vagrant ssh" there is no docker inside the precise64 vm. How can I make sure that docker is installed already in precise64 on startup?

PS: vagrantfile is not allowing " config.vm.provision "docker" "

Upvotes: 1

Views: 951

Answers (3)

Thomasleveil
Thomasleveil

Reputation: 103915

The following Vagrantfile will get you a VM with docker ready to go:

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
  config.vm.box = "phusion/ubuntu-14.04-amd64"
  config.vm.hostname = "dockerhost"

  config.vm.provision "shell", inline: <<-SCRIPT
    curl -sL https://get.docker.io/ | sh
    curl -sL https://raw.githubusercontent.com/dotcloud/docker/master/contrib/completion/bash/docker > /etc/bash_completion.d/docker
    adduser vagrant docker
  SCRIPT

end

EDIT :

Even easier, you can now use Docker Toolbox to get up and running.

Upvotes: 2

MrTambourineMan
MrTambourineMan

Reputation: 1045

Upgrading the Vagrant to 1.6.5 resolves the issue.

Upvotes: 0

kBisla
kBisla

Reputation: 640

You might be using old version of vagrant.

config.vm.provision "docker" work only with vagrant 1.6.5 .

Try upgrading your vagrant to 1.6.5. It will resolve the issue.

Upvotes: 1

Related Questions