Skip to content

Instantly share code, notes, and snippets.

@fgrehm
Last active September 5, 2017 03:44
Show Gist options
  • Save fgrehm/fc48fb51ec7df64439e4 to your computer and use it in GitHub Desktop.
Save fgrehm/fc48fb51ec7df64439e4 to your computer and use it in GitHub Desktop.
Vagrant VBox machine for usage with docker-provider
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Just in case you have something else configured
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'virtualbox'
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "raring64"
config.vm.box_url = 'http://cloud-images.ubuntu.com/vagrant/raring/current/raring-server-cloudimg-amd64-vagrant-disk1.box'
config.vm.network :private_network, ip: "192.168.50.102"
if Vagrant.has_plugin?('vagrant-cachier')
config.cache.auto_detect = true
end
config.vm.provider :virtualbox do |vb, override|
vb.customize [ "modifyvm", :id, "--memory", 1536, "--cpus", "2" ]
end
# Install docker on the machine
config.vm.provision :docker
# Install Vagrant
config.vm.provision :shell, inline: %[
if $(which vagrant > /dev/null 2>/dev/null); then
exit 0
fi
wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.4.3_x86_64.deb -O /tmp/vagrant.deb
dpkg -i /tmp/vagrant.deb
]
# Install docker-provider
config.vm.provision :shell, privileged: false, inline: %[
if $(vagrant plugin list | grep -q 'docker-provider'); then
exit 0
fi
vagrant plugin install docker-provider
]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment