Class: LambdaRubyBundler::Container Private

Inherits:
Object
  • Object
show all
Defined in:
lib/lambda_ruby_bundler/container.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Wrapper around [Docker::Container] for creating, running and removing bundler containers.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root_path, app_path, volume, build_dependencies) ⇒ Container

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Container.



10
11
12
13
14
15
# File 'lib/lambda_ruby_bundler/container.rb', line 10

def initialize(root_path, app_path, volume, build_dependencies)
  @root_path = root_path
  @app_path = app_path
  @volume = volume
  @build_dependencies = build_dependencies
end

Instance Attribute Details

#app_pathObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
# File 'lib/lambda_ruby_bundler/container.rb', line 8

def app_path
  @app_path
end

#build_dependenciesObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
# File 'lib/lambda_ruby_bundler/container.rb', line 8

def build_dependencies
  @build_dependencies
end

#root_pathObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
# File 'lib/lambda_ruby_bundler/container.rb', line 8

def root_path
  @root_path
end

#volumeObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
# File 'lib/lambda_ruby_bundler/container.rb', line 8

def volume
  @volume
end

Instance Method Details

#destroyObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



23
24
25
26
# File 'lib/lambda_ruby_bundler/container.rb', line 23

def destroy
  container.remove
  @container = nil
end

#run(timeout: 120) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



17
18
19
20
21
# File 'lib/lambda_ruby_bundler/container.rb', line 17

def run(timeout: 120)
  container.start

  container.attach({}, read_timeout: timeout)
end