Class: Docks::Build

Inherits:
Object
  • Object
show all
Includes:
FromHash
Defined in:
lib/docks/build.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#filenameObject

Returns the value of attribute filename.



4
5
6
# File 'lib/docks/build.rb', line 4

def filename
  @filename
end

#ops_strObject

Returns the value of attribute ops_str.



4
5
6
# File 'lib/docks/build.rb', line 4

def ops_str
  @ops_str
end

Instance Method Details

#build!Object



10
11
12
13
14
15
16
17
# File 'lib/docks/build.rb', line 10

def build!
  parsed = Docks.parsed(filename)
  File.create "#{temp_dir}/Dockerfile",parsed

  cmd = "docker build #{ops_str} #{temp_dir}"
  puts cmd
  exec cmd unless ops_str.to_s =~ /--mock/
end