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.
-
#privileged ⇒ Object
Returns the value of attribute privileged.
-
#volumes ⇒ Object
Returns the value of attribute volumes.
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 11 12 |
# File 'lib/docker-provider/config.rb', line 6 def initialize @image = nil @cmd = UNSET_VALUE @ports = [] @privileged = UNSET_VALUE @volumes = [] 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 |
#privileged ⇒ Object
Returns the value of attribute privileged.
4 5 6 |
# File 'lib/docker-provider/config.rb', line 4 def privileged @privileged end |
#volumes ⇒ Object
Returns the value of attribute volumes.
4 5 6 |
# File 'lib/docker-provider/config.rb', line 4 def volumes @volumes end |
Instance Method Details
#finalize! ⇒ Object
14 15 16 17 |
# File 'lib/docker-provider/config.rb', line 14 def finalize! @cmd = [] if @cmd == UNSET_VALUE @privileged = false if @privileged == UNSET_VALUE end |
#validate(machine) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/docker-provider/config.rb', line 19 def validate(machine) errors = _detected_errors # 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 |