Class: Buildizer::Image::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/buildizer/image/base.rb

Direct Known Subclasses

Centos, Ubuntu

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(docker, **kwargs) ⇒ Base

Returns a new instance of Base.



9
10
11
12
13
14
# File 'lib/buildizer/image/base.rb', line 9

def initialize(docker, **kwargs)
  @instructions = []
  @docker = docker

  instruction :FROM, base_image
end

Instance Attribute Details

#dockerObject (readonly)

Returns the value of attribute docker.



5
6
7
# File 'lib/buildizer/image/base.rb', line 5

def docker
  @docker
end

#instructionsObject (readonly)

Returns the value of attribute instructions.



4
5
6
# File 'lib/buildizer/image/base.rb', line 4

def instructions
  @instructions
end

#targetObject

Returns the value of attribute target.



7
8
9
# File 'lib/buildizer/image/base.rb', line 7

def target
  @target
end

Instance Method Details

#base_imageObject



43
44
45
# File 'lib/buildizer/image/base.rb', line 43

def base_image
  "buildizer/#{os_name}:#{os_version}"
end

#build_dep(build_dep) ⇒ Object



39
40
41
# File 'lib/buildizer/image/base.rb', line 39

def build_dep(build_dep)
  raise
end

#fpm_extra_paramsObject



36
37
# File 'lib/buildizer/image/base.rb', line 36

def fpm_extra_params
end

#fpm_output_typeObject



32
33
34
# File 'lib/buildizer/image/base.rb', line 32

def fpm_output_type
  raise
end

#instruction(instruction, cmd) ⇒ Object



51
52
53
# File 'lib/buildizer/image/base.rb', line 51

def instruction(instruction, cmd)
  instructions << [instruction.to_s.upcase, cmd].join(' ')
end

#nameObject



47
48
49
# File 'lib/buildizer/image/base.rb', line 47

def name
  target.docker_image
end

#native_build_instructions(builder, target) ⇒ Object



59
60
61
# File 'lib/buildizer/image/base.rb', line 59

def native_build_instructions(builder, target)
  raise
end

#os_nameObject



16
17
18
# File 'lib/buildizer/image/base.rb', line 16

def os_name
  raise
end

#os_package_cloud_nameObject



20
21
22
# File 'lib/buildizer/image/base.rb', line 20

def os_package_cloud_name
  os_name
end

#os_package_cloud_versionObject



24
25
26
# File 'lib/buildizer/image/base.rb', line 24

def os_package_cloud_version
  os_version
end

#os_versionObject



28
29
30
# File 'lib/buildizer/image/base.rb', line 28

def os_version
  raise
end

#patch_build_dep(builder, target) ⇒ Object



55
56
57
# File 'lib/buildizer/image/base.rb', line 55

def patch_build_dep(builder, target)
  target_package_spec(target)
end

#patch_build_instructions(builder, target) ⇒ Object



63
64
65
# File 'lib/buildizer/image/base.rb', line 63

def patch_build_instructions(builder, target)
  raise
end

#target_package_spec(target) ⇒ Object



67
68
69
# File 'lib/buildizer/image/base.rb', line 67

def target_package_spec(target)
  raise
end