Class: Kubes::Docker::Args::Default

Inherits:
Object
  • Object
show all
Defined in:
lib/kubes/docker/args/default.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, image_name, options = {}) ⇒ Default

Returns a new instance of Default.



3
4
5
6
# File 'lib/kubes/docker/args/default.rb', line 3

def initialize(name, image_name, options={})
  @name, @image_name, @options = name.to_s, image_name, options
  @dockerfile = "Dockerfile"
end

Instance Method Details

#argsObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/kubes/docker/args/default.rb', line 8

def args
  case @name
  when "build"
    build_args
  when "push"
    [@image_name]
  else
    []
  end
end

#build_argsObject



19
20
21
# File 'lib/kubes/docker/args/default.rb', line 19

def build_args
  ["-t #{@image_name} -f #{@dockerfile} ."]
end