Class: Space::Core::OciBuilder
- Inherits:
-
Object
- Object
- Space::Core::OciBuilder
- Defined in:
- lib/space_core/oci_builder.rb
Instance Method Summary collapse
- #command ⇒ Object
- #image ⇒ Object
-
#initialize(space:, output_dir:) ⇒ OciBuilder
constructor
A new instance of OciBuilder.
- #latest ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(space:, output_dir:) ⇒ OciBuilder
Returns a new instance of OciBuilder.
11 12 13 14 |
# File 'lib/space_core/oci_builder.rb', line 11 def initialize(space:, output_dir:) @space = space @output_dir = Pathname.new(output_dir) end |
Instance Method Details
#command ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/space_core/oci_builder.rb', line 28 def command compute_version.fmap do |ver| [ "container", "build", "-f", @output_dir.join("Dockerfile").to_s, "-t", "#{space.id}:#{ver}", "-t", latest, space.path.to_s ] end end |
#image ⇒ Object
20 21 22 |
# File 'lib/space_core/oci_builder.rb', line 20 def image "#{space.id}:#{version}" end |
#latest ⇒ Object
24 25 26 |
# File 'lib/space_core/oci_builder.rb', line 24 def latest "#{space.id}:latest" end |
#version ⇒ Object
16 17 18 |
# File 'lib/space_core/oci_builder.rb', line 16 def version compute_version.value! end |