Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update docker login reference #5386

Merged
merged 2 commits into from
Sep 3, 2024

Conversation

dvdksn
Copy link
Contributor

@dvdksn dvdksn commented Sep 2, 2024

Signed-off-by: David Karlsson [email protected]

@codecov-commenter
Copy link

codecov-commenter commented Sep 2, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 60.94%. Comparing base (6273e65) to head (81744d7).
Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5386      +/-   ##
==========================================
+ Coverage   60.93%   60.94%   +0.01%     
==========================================
  Files         304      304              
  Lines       21346    21346              
==========================================
+ Hits        13007    13010       +3     
+ Misses       7409     7407       -2     
+ Partials      930      929       -1     

docs/reference/commandline/login.md Outdated Show resolved Hide resolved
Comment on lines 45 to 48
your Docker account without entering your password. For Docker Hub, the `docker
login` command uses a device code flow by default, unless the `--username` flag
is specified. The device code flow is a secure way to sign in. See
[Authenticate to Docker Hub using device code](#authenticate-to-docker-hub-using-device-code).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also disable the interactive flow when run non-interactively (no TTY) (not 100% sure)

Would it make sense to have a heading about non-interactive authentication?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we could... @laurazard do we have some special sauce for handling login differently for non-TTY cases?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, we don't. With --username, without setting the password we do error out if non-tty:

$ docker login -u bork 0>/dev/null
Error: Cannot perform an interactive login from a non TTY device

But with the device-code flow, we don't:

$ docker login 0>/dev/null

USING WEB BASED LOGIN
To sign in with credentials on the command line, use 'docker login -u <username>'

Your one-time device confirmation code is: <--->
Press ENTER to open your browser or submit your device code here: https://login.docker.com/activate

Waiting for authentication in the browser…

Although in the first case, there's no way for the user to login when non-interactive, but with the device-code flow a user could open the URL and login on another device. Maybe we should though 🤔

docs/reference/commandline/login.md Show resolved Hide resolved
docs/reference/commandline/login.md Outdated Show resolved Hide resolved
Copy link
Member

@laurazard laurazard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for this @dvdksn

docs/reference/commandline/login.md Outdated Show resolved Hide resolved
docs/reference/commandline/login.md Outdated Show resolved Hide resolved
Signed-off-by: David Karlsson <[email protected]>
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah merged commit e3676d2 into docker:master Sep 3, 2024
89 checks passed
@thaJeztah
Copy link
Member

@dvdksn can you open a cherry-pick as well?

@dvdksn dvdksn deleted the docker-login-docs-touchup branch September 3, 2024 10:21
thaJeztah added a commit that referenced this pull request Sep 3, 2024
[27.x backport] docs: update docker login reference #5386
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants