providers/docker: Implement public_address capability for `vagrant share`
This commit is contained in:
parent
c0aa05c62a
commit
d705c48ef3
|
@ -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
|
|
@ -28,6 +28,11 @@ module VagrantPlugins
|
|||
SyncedFolder
|
||||
end
|
||||
|
||||
provider_capability("docker", "public_address") do
|
||||
require_relative "cap/public_address"
|
||||
Cap::PublicAddress
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def self.init!
|
||||
|
|
Loading…
Reference in New Issue