class NexusAPI::DockerShell

Public Instance Methods

authenticate!(username, password, host) click to toggle source
# File lib/nexus_api/docker_shell.rb, line 20
def authenticate!(username, password, host)
  Docker.authenticate!(
    'username' => username,
    'password' => password,
    'serveraddress' => host
  )
end
list_images() click to toggle source
# File lib/nexus_api/docker_shell.rb, line 28
def list_images
  Docker::Image.all
end
pull_image(username, password, image_name) click to toggle source
# File lib/nexus_api/docker_shell.rb, line 9
def pull_image(username, password, image_name)
  Docker::Image.create(
    'username' => username,
    'password' => password,
    'fromImage' => image_name
  )
rescue Docker::Error::ClientError => error
  puts "Error: Could not pull Docker image '#{image_name}'"
  puts error
end
validate_version!() click to toggle source
# File lib/nexus_api/docker_shell.rb, line 5
def validate_version!
  Docker.validate_version!
end