Class: VagrantPlugins::DockerProvider::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::DockerProvider::Config
- Defined in:
- lib/docker-provider/config.rb
Instance Attribute Summary collapse
-
#cmd ⇒ Object
Returns the value of attribute cmd.
-
#image ⇒ Object
Returns the value of attribute image.
-
#ports ⇒ Object
Returns the value of attribute ports.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #validate(machine) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
6 7 8 9 10 |
# File 'lib/docker-provider/config.rb', line 6 def initialize @image = UNSET_VALUE @cmd = UNSET_VALUE @ports = UNSET_VALUE end |
Instance Attribute Details
#cmd ⇒ Object
Returns the value of attribute cmd.
4 5 6 |
# File 'lib/docker-provider/config.rb', line 4 def cmd @cmd end |
#image ⇒ Object
Returns the value of attribute image.
4 5 6 |
# File 'lib/docker-provider/config.rb', line 4 def image @image end |
#ports ⇒ Object
Returns the value of attribute ports.
4 5 6 |
# File 'lib/docker-provider/config.rb', line 4 def ports @ports end |
Instance Method Details
#finalize! ⇒ Object
12 13 14 15 |
# File 'lib/docker-provider/config.rb', line 12 def finalize! @ports = [] if @ports == UNSET_VALUE @cmd = [] if @cmd == UNSET_VALUE end |
#validate(machine) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/docker-provider/config.rb', line 17 def validate(machine) errors = _detected_errors errors << I18n.t("docker_provider.errors.config.image_not_set") if @image == UNSET_VALUE # TODO: Detect if base image has a CMD / ENTRYPOINT set before erroring out errors << I18n.t("docker_provider.errors.config.cmd_not_set") if @cmd == UNSET_VALUE { "docker-provider" => errors } end |