providers/docker: forward ports properly
This commit is contained in:
parent
471b3b4059
commit
aee71a093b
|
@ -13,6 +13,7 @@ BUG FIXES:
|
||||||
- core: Don't lock machines on SSH actions. [GH-3664]
|
- core: Don't lock machines on SSH actions. [GH-3664]
|
||||||
- providers/docker: default proxy VM won't use HGFS [GH-3687]
|
- providers/docker: default proxy VM won't use HGFS [GH-3687]
|
||||||
- providers/docker: fix container linking [GH-3719]
|
- providers/docker: fix container linking [GH-3719]
|
||||||
|
- providers/docker: Port settings expose to host properly. [GH-3723]
|
||||||
|
|
||||||
## 1.6.1 (May 7, 2014)
|
## 1.6.1 (May 7, 2014)
|
||||||
|
|
||||||
|
|
|
@ -258,6 +258,7 @@ module VagrantPlugins
|
||||||
b3.use HostMachinePortChecker
|
b3.use HostMachinePortChecker
|
||||||
b3.use HandleForwardedPortCollisions
|
b3.use HandleForwardedPortCollisions
|
||||||
b3.use SyncedFolders
|
b3.use SyncedFolders
|
||||||
|
b3.use ForwardedPorts
|
||||||
b3.use Create
|
b3.use Create
|
||||||
b3.use WaitForRunning
|
b3.use WaitForRunning
|
||||||
else
|
else
|
||||||
|
@ -288,6 +289,7 @@ module VagrantPlugins
|
||||||
autoload :Create, action_root.join("create")
|
autoload :Create, action_root.join("create")
|
||||||
autoload :Destroy, action_root.join("destroy")
|
autoload :Destroy, action_root.join("destroy")
|
||||||
autoload :DestroyBuildImage, action_root.join("destroy_build_image")
|
autoload :DestroyBuildImage, action_root.join("destroy_build_image")
|
||||||
|
autoload :ForwardedPorts, action_root.join("forwarded_ports")
|
||||||
autoload :HasSSH, action_root.join("has_ssh")
|
autoload :HasSSH, action_root.join("has_ssh")
|
||||||
autoload :HostMachine, action_root.join("host_machine")
|
autoload :HostMachine, action_root.join("host_machine")
|
||||||
autoload :HostMachineBuildDir, action_root.join("host_machine_build_dir")
|
autoload :HostMachineBuildDir, action_root.join("host_machine_build_dir")
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
module VagrantPlugins
|
||||||
|
module DockerProvider
|
||||||
|
module Action
|
||||||
|
class ForwardedPorts
|
||||||
|
def initialize(app, env)
|
||||||
|
@app = app
|
||||||
|
end
|
||||||
|
|
||||||
|
def call(env)
|
||||||
|
env[:machine].provider_config.ports.each do |p|
|
||||||
|
host, guest = p.split(":", 2)
|
||||||
|
env[:machine].config.vm.network "forwarded_port",
|
||||||
|
host: host.to_i, guest: guest.to_i
|
||||||
|
end
|
||||||
|
|
||||||
|
@app.call(env)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue