docker / docker/cli

Add --timeout flag to docker login command

Open
#3,788 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/authentication kind/feature
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Description

If the Registry application takes a long time to authenticate a user, the docker cli will cancel the request and return something like this:

Error response from daemon: Get https://myregistry.com/v2/: Get https://myregistry.com/service/token?
account=myaccount&client_id=docker&offline_token=true&service=myservice: net/http: request canceled
(Client.Timeout exceeded while awaiting headers) (Client.Timeout exceeded while awaiting headers)

We know that this happens when the Registry application (Harbor) uses Active Directory to authenticate and the user or account is part of many Active Directory groups.

I would like to know if it is possible to add a new flag (--timeout) to the login command to set the desired timeout to wait before cancelling the login request. If this is wanted, I can also work on the change.

Thanks

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the docker login command and trace the reported request-cancellation path. Determine how a user-supplied --timeout should affect the login request and where relevant command tests live. Done means the flag is supported and a login can wait for the configured duration without the current premature cancellation.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.