Class: Dip::Commands::DNS::Up

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:, socket:, net:, publish:, image:, domain:) ⇒ Up

Returns a new instance of Up.


10
11
12
13
14
15
16
17
# File 'lib/dip/commands/dns.rb', line 10

def initialize(name:, socket:, net:, publish:, image:, domain:)
  @name = name
  @socket = socket
  @net = net
  @publish = publish
  @image = image
  @domain = domain
end

Instance Method Details

#executeObject


19
20
21
22
# File 'lib/dip/commands/dns.rb', line 19

def execute
  exec_subprocess("docker", "network create #{@net}", panic: false, err: File::NULL)
  exec_subprocess("docker", "run #{container_args} #{@image} --domain=#{@domain}")
end