Method: Docker.authenticate!

Defined in:
lib/docker.rb

.authenticate!(options = {}, connection = self.connection) ⇒ Object

Login to the Docker registry.



133
134
135
136
137
138
139
140
# File 'lib/docker.rb', line 133

def authenticate!(options = {}, connection = self.connection)
  creds = MultiJson.dump(options)
  connection.post('/auth', {}, body: creds)
  @creds = creds
  true
rescue Docker::Error::ServerError, Docker::Error::UnauthorizedError
  raise Docker::Error::AuthenticationError
end