providers/docker: Implement public_address capability for `vagrant share`

This commit is contained in:
Fabio Rehm 2014-03-27 21:10:48 -03:00 committed by Mitchell Hashimoto
parent c0aa05c62a
commit d705c48ef3
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,15 @@
module VagrantPlugins
module DockerProvider
module Cap
module PublicAddress
def self.public_address(machine)
return nil if machine.state.id != :running
ssh_info = machine.ssh_info
return nil if !ssh_info
ssh_info[:host]
end
end
end
end
end

View File

@ -28,6 +28,11 @@ module VagrantPlugins
SyncedFolder SyncedFolder
end end
provider_capability("docker", "public_address") do
require_relative "cap/public_address"
Cap::PublicAddress
end
protected protected
def self.init! def self.init!