Class: Escualo::Script::Dockerized
Instance Attribute Summary collapse
-
#dockerfile ⇒ Object
Returns the value of attribute dockerfile.
Instance Method Summary collapse
- #base_image(options) ⇒ Object
- #finish! ⇒ Object
- #run_command!(command, ssh, options) ⇒ Object
- #start!(options) ⇒ Object
Methods inherited from Mode
Instance Attribute Details
#dockerfile ⇒ Object
Returns the value of attribute dockerfile.
39 40 41 |
# File 'lib/escualo/script.rb', line 39 def dockerfile @dockerfile end |
Instance Method Details
#base_image(options) ⇒ Object
50 51 52 53 54 55 56 57 58 |
# File 'lib/escualo/script.rb', line 50 def base_image() if .base_image == 'ubuntu' 'ubuntu:xenial' elsif .base_image == 'debian' 'debian:jessie' else raise "Unsupported base image #{.base_image}. Only debian and ubuntu are supported" end end |
#finish! ⇒ Object
64 65 66 |
# File 'lib/escualo/script.rb', line 64 def finish! File.write('Dockerfile', @dockerfile) end |
#run_command!(command, ssh, options) ⇒ Object
60 61 62 |
# File 'lib/escualo/script.rb', line 60 def run_command!(command, ssh, ) @dockerfile << "RUN #{command}\n" end |