Class: Dockerspec::Builder
- Inherits:
-
Object
- Object
- Dockerspec::Builder
- Defined in:
- lib/dockerspec/builder.rb,
lib/dockerspec/builder/logger.rb,
lib/dockerspec/builder/image_gc.rb,
lib/dockerspec/builder/matchers.rb,
lib/dockerspec/builder/logger/ci.rb,
lib/dockerspec/builder/logger/info.rb,
lib/dockerspec/builder/logger/debug.rb,
lib/dockerspec/builder/logger/silent.rb,
lib/dockerspec/builder/config_helpers.rb,
lib/dockerspec/builder/matchers/helpers.rb
Overview
A class to build a container image.
Defined Under Namespace
Modules: ConfigHelpers, Matchers Classes: ImageGC, Logger
Instance Method Summary collapse
-
#build ⇒ String
Builds the docker image.
-
#id ⇒ String
Returns Docker image ID.
-
#initialize(*opts) ⇒ Builder
constructor
Constructs a Docker image builder class.
-
#to_s ⇒ String
Gets a descriptions of the object.
Methods included from Helper::MultipleSourcesDescription
Methods included from Helper::CI
#ci?, #circle_ci?, #travis_ci?
Methods included from ConfigHelpers
#architecture, #cmd, #entrypoint, #envs, #expose, #exposes, #image_config, #label, #labels, #maintainer, #onbuild, #onbuilds, #os, #size, #stopsignal, #user, #volume, #volumes, #workdir
Constructor Details
#initialize(*opts) ⇒ Builder
Constructs a Docker image builder class.
95 96 97 98 |
# File 'lib/dockerspec/builder.rb', line 95 def initialize(*opts) @image = nil @options = (opts) end |
Instance Method Details
#build ⇒ String
Builds the docker image.
129 130 131 132 |
# File 'lib/dockerspec/builder.rb', line 129 def build send("build_from_#{source}", @options[source]) self end |
#id ⇒ String
Returns Docker image ID.
112 113 114 |
# File 'lib/dockerspec/builder.rb', line 112 def id @image.id end |
#to_s ⇒ String
Gets a descriptions of the object.
145 146 147 |
# File 'lib/dockerspec/builder.rb', line 145 def to_s description('Docker Build from') end |