Skip to content

Commit

Permalink
feat(Vagrantfile): add forwarded ports configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mboersma committed Mar 16, 2015
1 parent 27d820d commit 2c44c68
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ $share_home = false
$vm_gui = false
$vm_memory = 2048
$vm_cpus = 1
$shared_folders = {}
$forwarded_ports = {}

# Attempt to apply the deprecated environment variable NUM_INSTANCES to
# $num_instances while allowing config.rb to override it
Expand Down Expand Up @@ -111,6 +113,10 @@ Vagrant.configure("2") do |config|
config.vm.network "forwarded_port", guest: 2375, host: ($expose_docker_tcp + i - 1), auto_correct: true
end

$forwarded_ports.each do |guest, host|
config.vm.network "forwarded_port", guest: guest, host: host, auto_correct: true
end

["vmware_fusion", "vmware_workstation"].each do |vmware|
config.vm.provider vmware do |v|
v.gui = vm_gui
Expand All @@ -130,6 +136,9 @@ Vagrant.configure("2") do |config|

# Uncomment below to enable NFS for sharing the host machine into the coreos-vagrant VM.
#config.vm.synced_folder ".", "/home/core/share", id: "core", :nfs => true, :mount_options => ['nolock,vers=3,udp']
$shared_folders.each_with_index do |(host_folder, guest_folder), index|
config.vm.synced_folder host_folder.to_s, guest_folder.to_s, id: "core-share%02d" % index, nfs: true, mount_options: ['nolock,vers=3,udp']
end

if $share_home
config.vm.synced_folder ENV['HOME'], ENV['HOME'], id: "home", :nfs => true, :mount_options => ['nolock,vers=3,udp']
Expand Down

0 comments on commit 2c44c68

Please sign in to comment.