class Dockly::Docker::ECR
Public Instance Methods
auth_data()
click to toggle source
# File lib/dockly/docker/ecr.rb, line 39 def auth_data @auth_data ||= client .get_authorization_token .authorization_data .first end
authenticate!()
click to toggle source
# File lib/dockly/docker/ecr.rb, line 9 def authenticate! @username ||= login_from_aws[0] @password ||= login_from_aws[1] ensure_present! :password, :server_address, :username debug "Attempting to authenticate at #{server_address}" ::Docker.authenticate!(self.to_h) info "Successfully authenticated at #{server_address}" rescue ::Docker::Error::AuthenticationError raise "Could not authenticate at #{server_address}" end
authentication_required?()
click to toggle source
# File lib/dockly/docker/ecr.rb, line 24 def authentication_required? true end
client()
click to toggle source
# File lib/dockly/docker/ecr.rb, line 47 def client @client ||= Aws::ECR::Client.new(region: 'us-east-1') end
default_server_address?()
click to toggle source
# File lib/dockly/docker/ecr.rb, line 28 def default_server_address? false end
login_from_aws()
click to toggle source
# File lib/dockly/docker/ecr.rb, line 32 def login_from_aws @login_from_aws ||= Base64 .decode64(auth_data.authorization_token) .split(':') end
to_h()
click to toggle source
# File lib/dockly/docker/ecr.rb, line 51 def to_h ensure_present! :username, :password, :server_address { 'serveraddress' => "https://#{server_address}", 'username' => username, 'password' => password } end