Class: Dip::Commands::DNS::IP

Inherits:
Dip::Command show all
Defined in:
lib/dip/commands/dns.rb

Instance Method Summary collapse

Methods inherited from Dip::Command

exec_program, exec_subprocess

Constructor Details

#initialize(name:, net:) ⇒ IP



49
50
51
52
# File 'lib/dip/commands/dns.rb', line 49

def initialize(name:, net:)
  @name = name
  @net = net
end

Instance Method Details

#execute(**options) ⇒ Object



54
55
56
57
58
59
60
# File 'lib/dip/commands/dns.rb', line 54

def execute(**options)
  exec_subprocess(
    "docker",
    "inspect --format '{{ .NetworkSettings.Networks.#{@net}.IPAddress }}' #{@name}",
    **options
  )
end