Class: Buildizer::Image::Base
- Inherits:
-
Object
- Object
- Buildizer::Image::Base
- Defined in:
- lib/buildizer/image/base.rb
Instance Attribute Summary collapse
-
#docker ⇒ Object
readonly
Returns the value of attribute docker.
-
#instructions ⇒ Object
readonly
Returns the value of attribute instructions.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
- #base_image ⇒ Object
- #build_dep(build_dep) ⇒ Object
- #fpm_extra_params ⇒ Object
- #fpm_output_type ⇒ Object
-
#initialize(docker, **kwargs) ⇒ Base
constructor
A new instance of Base.
- #instruction(instruction, cmd) ⇒ Object
- #name ⇒ Object
- #native_build_instructions(builder, target) ⇒ Object
- #os_name ⇒ Object
- #os_package_cloud_name ⇒ Object
- #os_package_cloud_version ⇒ Object
- #os_version ⇒ Object
- #patch_build_dep(builder, target) ⇒ Object
- #patch_build_instructions(builder, target) ⇒ Object
- #target_package_spec(target) ⇒ Object
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
#docker ⇒ Object (readonly)
Returns the value of attribute docker.
5 6 7 |
# File 'lib/buildizer/image/base.rb', line 5 def docker @docker end |
#instructions ⇒ Object (readonly)
Returns the value of attribute instructions.
4 5 6 |
# File 'lib/buildizer/image/base.rb', line 4 def instructions @instructions end |
#target ⇒ Object
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_image ⇒ Object
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_params ⇒ Object
36 37 |
# File 'lib/buildizer/image/base.rb', line 36 def fpm_extra_params end |
#fpm_output_type ⇒ Object
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 |
#name ⇒ Object
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_name ⇒ Object
16 17 18 |
# File 'lib/buildizer/image/base.rb', line 16 def os_name raise end |
#os_package_cloud_name ⇒ Object
20 21 22 |
# File 'lib/buildizer/image/base.rb', line 20 def os_package_cloud_name os_name end |
#os_package_cloud_version ⇒ Object
24 25 26 |
# File 'lib/buildizer/image/base.rb', line 24 def os_package_cloud_version os_version end |
#os_version ⇒ Object
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 |