def authenticate!(options = {}, connection = self.connection)
      creds = options.to_json
      connection.post('/auth', {}, :body => creds)
      @creds = creds
      true
    rescue Docker::Error::ServerError, Docker::Error::UnauthorizedError
      raise Docker::Error::AuthenticationError
    end
def authenticate!(options = {}, connection = self.connection)
      creds = options.to_json
      connection.post('/auth', {}, :body => creds)
      @creds = creds
      true
    rescue Docker::Error::ServerError, Docker::Error::UnauthorizedError
      raise Docker::Error::AuthenticationError
    end
Login to the Docker registry.