Class: EacDocker::Images::Named

Inherits:
Base
  • Object
show all
Defined in:
lib/eac_docker/images/named.rb

Instance Method Summary collapse

Methods inherited from Base

#container

Instance Method Details

#docker_provide_argsObject



27
28
29
# File 'lib/eac_docker/images/named.rb', line 27

def docker_provide_args
  ['pull', source_tag]
end

#exist?Boolean

Returns:

  • (Boolean)


9
10
11
12
# File 'lib/eac_docker/images/named.rb', line 9

def exist?
  ::EacDocker::Executables.docker.command('image', 'inspect', source_tag).execute
    .fetch(:exit_code).zero?
end

#idObject



14
15
16
# File 'lib/eac_docker/images/named.rb', line 14

def id
  source_tag
end

#provideObject



18
19
20
21
# File 'lib/eac_docker/images/named.rb', line 18

def provide
  provide_command.execute! unless exist?
  self
end

#provide_commandObject



23
24
25
# File 'lib/eac_docker/images/named.rb', line 23

def provide_command
  ::EacDocker::Executables.docker.command(*docker_provide_args)
end