Cli: "docker login" doesn't run in Linux without X11

Created on 17 Dec 2019  路  7Comments  路  Source: docker/cli

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.

aredistribution

Most helpful comment

For me just installing 'pass' solved this issue.

All 7 comments

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 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.

@XanderStrike After installing pass there's more configuration:

  1. Make sure pass is configured correctly, see e.g. https://medium.com/@thoferon/sharing-passwords-with-git-gpg-and-pass-628c2db2a9de
  2. Set up docker to use pass as a store: https://github.com/docker/docker-credential-helpers
Was this page helpful?
0 / 5 - 0 ratings