Skip to content

Instantly share code, notes, and snippets.

@jpbarto
Last active May 9, 2016 09:30
Show Gist options
  • Save jpbarto/7ec7aec1d0a8c01bc575172cb3a3d6e2 to your computer and use it in GitHub Desktop.
Save jpbarto/7ec7aec1d0a8c01bc575172cb3a3d6e2 to your computer and use it in GitHub Desktop.
Vagrantfile for the creation of a Docker host within either a local Virtualbox or a VSphere cloud environment
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "dummy"
config.vm.provider :virtualbox do |vbox, override|
override.vm.box = 'blinkreaction/boot2docker'
end
config.vm.provider :vsphere do |vsphere|
vsphere.host = '10.23.33.34'
vsphere.insecure = true
vsphere.customization_spec_name = 'Vagrant_Linux-LAB 1-spec'
vsphere.template_name = 'UKSOLAS CLOUD/SILVER_Cluster/VRM/ICT/LAB 1/ubuntu_16_docker_vagrant_base'
vsphere.clone_from_vm = true
vsphere.vm_base_path = 'UKSOLAS CLOUD/SILVER_Cluster/VRM/ICT/LAB 1'
vsphere.vlan = 'LAB-1-LAN-1 (1002)'
vsphere.user = 'uksolas\username'
vsphere.password = 'your-password'
vsphere.cpu_count = 2
vsphere.memory_mb = 4096
end
config.vm.define "node1" do |node|
node.vm.hostname = "node1.docker.local"
node.vm.provider :vsphere do |v, override|
override.vm.network 'private_network', ip: '172.16.201.99'
end
node.vm.provider :virtualbox do |vbox, override|
override.vm.network 'private_network', ip: '192.168.33.45'
end
node.vm.provision :docker do |d|
d.run "my-redis",
image: "redis",
args: "-p 6379:6379",
daemonize: true,
restart: "always"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment