mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add an option to forward all ports to the vagrant host that have been exported from docker containers
This commit is contained in:
parent
da937bf214
commit
302660e362
1 changed files with 15 additions and 0 deletions
15
Vagrantfile
vendored
15
Vagrantfile
vendored
|
@ -5,6 +5,7 @@ BOX_NAME = ENV['BOX_NAME'] || "ubuntu"
|
||||||
BOX_URI = ENV['BOX_URI'] || "http://files.vagrantup.com/precise64.box"
|
BOX_URI = ENV['BOX_URI'] || "http://files.vagrantup.com/precise64.box"
|
||||||
AWS_REGION = ENV['AWS_REGION'] || "us-east-1"
|
AWS_REGION = ENV['AWS_REGION'] || "us-east-1"
|
||||||
AWS_AMI = ENV['AWS_AMI'] || "ami-d0f89fb9"
|
AWS_AMI = ENV['AWS_AMI'] || "ami-d0f89fb9"
|
||||||
|
FORWARD_DOCKER_PORTS = ENV['FORWARD_DOCKER_PORTS']
|
||||||
|
|
||||||
Vagrant::Config.run do |config|
|
Vagrant::Config.run do |config|
|
||||||
# Setup virtual machine box. This VM configuration code is always executed.
|
# Setup virtual machine box. This VM configuration code is always executed.
|
||||||
|
@ -70,3 +71,17 @@ Vagrant::VERSION >= "1.1.0" and Vagrant.configure("2") do |config|
|
||||||
config.vm.box_url = BOX_URI
|
config.vm.box_url = BOX_URI
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if !FORWARD_DOCKER_PORTS.nil?
|
||||||
|
Vagrant::VERSION < "1.1.0" and Vagrant::Config.run do |config|
|
||||||
|
(49000..49900).each do |port|
|
||||||
|
config.vm.forward_port port, port
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Vagrant::VERSION >= "1.1.0" and Vagrant.configure("2") do |config|
|
||||||
|
(49000..49900).each do |port|
|
||||||
|
config.vm.network :forwarded_port, :host => port, :guest => port
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in a new issue