I cannot use the command docker login quay.io in Linux unless I am running in a command-line environment that is hosted by some kind of GUI. Otherwise, I get: (whether or not it's "quay.io" ...)
Error saving credentials: error storing credentials - err: exit status 1, out: Cannot autolaunch D-Bus without X11 $DISPLAY
... and the login does not succeed.
Many Linux systems do not have any sort of GUI environment installed on them, and so the docker login command should not assume that it may use any sort of "password safe" or "keyring" mechanism that exists only in such worlds.
P.S. It doesn't matter if I do or don't use sudo and yes I am a member of the docker group. Fundamentally, the command appears to want to rely on a "keyring" that doesn't exist outside of X11! This is a very fundamental design flaw.
Sounds like you may have the golang-docker-credential-helpers package installed; that package is not shipping with docker by default, but something that's packaged by Ubuntu (and possibly other distros). The golang-docker-credential-helpers provides helpers for both the secretservice and pass credential stores, but if pass is not installed, it picks secretservice as store, which is part of Gnome, and only works in interactive sessions.
@thaJeztah, so the solution is ... ?
Remove the golang-docker-credential-helpers or install pass ?
Yes, if you want to run without X11 / run headless, then that's the solution
For me just installing 'pass' solved this issue.
Installing pass worked for me, but I'm still getting the following message:
WARNING! Your password will be stored unencrypted in /home/xander/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
I'm having trouble understanding why there's a hard, undocumented dependency on installing a password manager when my credentials are then stored in plaintext without using the password manager.
Installing
passworked for me, but I'm still getting the following message:WARNING! Your password will be stored unencrypted in /home/xander/.docker/config.json. Configure a credential helper to remove this warning. See https://docs.docker.com/engine/reference/commandline/login/#credentials-storeI'm having trouble understanding why there's a hard, undocumented dependency on installing a password manager when my credentials are then stored in plaintext without using the password manager.
@XanderStrike After installing pass there's more configuration:
pass is configured correctly, see e.g. https://medium.com/@thoferon/sharing-passwords-with-git-gpg-and-pass-628c2db2a9de
Most helpful comment
For me just installing 'pass' solved this issue.