Class: Hako::Container
- Inherits:
-
Object
- Object
- Hako::Container
- Defined in:
- lib/hako/container.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
Instance Method Summary collapse
- #env ⇒ Object
-
#initialize(app, definition, dry_run:) ⇒ Container
constructor
A new instance of Container.
- #mount_points ⇒ Object
Constructor Details
#initialize(app, definition, dry_run:) ⇒ Container
Returns a new instance of Container.
8 9 10 11 12 13 |
# File 'lib/hako/container.rb', line 8 def initialize(app, definition, dry_run:) @app = app @definition = default_config.merge(definition) @definition['docker_labels'].merge!(default_labels) @dry_run = dry_run end |
Instance Attribute Details
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
6 7 8 |
# File 'lib/hako/container.rb', line 6 def definition @definition end |
Instance Method Details
#env ⇒ Object
31 32 33 |
# File 'lib/hako/container.rb', line 31 def env @expanded_env ||= (@definition.fetch('env', {})) end |
#mount_points ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/hako/container.rb', line 35 def mount_points @definition['mount_points'].map do |mount_point| { source_volume: mount_point.fetch('source_volume'), container_path: mount_point.fetch('container_path'), read_only: mount_point.fetch('read_only', false), } end end |