compose: docker login fails while docker-compose is installed on Ubuntu 18.04
Description of the issue
docker login error getting credentials - err: exit status 1, out:
Cannot autolaunch D-Bus without X11 $DISPLAY
This error appears on a fresh Ubuntu Server 18.04 install. It has virtually nothing installed except docker and docker-compose. This error only occurs when docker-compose is installed.
Typing sudo apt remove docker-compose
clears the error. Login now occurs using the normal docker prompt.
Context information (for bug reports)
Output of "docker-compose version"
docker-compose version 1.17.1, build unknown docker-py version: 2.5.1 CPython version: 2.7.15rc1 OpenSSL version: OpenSSL 1.1.0g 2 Nov 2017
Output of "docker version"
Client: Version: 17.12.1-ce API version: 1.35 Go version: go1.10.1 Git commit: 7390fc6 Built: Wed Apr 18 01:23:11 2018 OS/Arch: linux/amd64
Server: Engine: Version: 17.12.1-ce API version: 1.35 (minimum version 1.12) Go version: go1.10.1 Git commit: 7390fc6 Built: Wed Feb 28 17:46:05 2018 OS/Arch: linux/amd64 Experimental: false
Output of "docker-compose config"
ubuntu@:~$ docker-compose config ERROR: Can’t find a suitable configuration file in this directory or any parent. Are you in the right directory?
Supported filenames: docker-compose.yml, docker-compose.yaml
Steps to reproduce the issue
sudo apt install docker
sudo apt install docker-compose
docker login
Observed result
error getting credentials - err: exit status 1, out:
Cannot autolaunch D-Bus without X11 $DISPLAY
Expected result
The normal docker login prompt.
Stacktrace / full error message
(if applicable)
Additional information
OS version / distribution, docker-compose
install method, etc.
Welcome to Ubuntu 18.04 LTS (GNU/Linux 4.15.0-1010-aws x86_64)
This machine was built using Amazon AWS’s Canonical Ubuntu 18.04 AMI. It has virtually nothing installed on it, except for docker, docker-compose and sshd.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 41
I’m having the same (or a similar) issue, running
docker login
failing with the error messageCannot autolaunch D-Bus without X11 $DISPLAY
. Having stumbled across https://github.com/docker/docker-credential-helpers/issues/60 it seems as ifgolang-docker-credential-helpers
causes the issue here. Temporarily uninstalling docker-compose including the package above allowed me to rundocker login
to authenticate with my docker registry.Since this is a bug in the Ubuntu packaging for server it needs to be fixed there but in the meantime a work-around without having to uninstall docker-compose temporarily or having to switch to the docker repos instead you can make it use
pass
instead. This is what I did:This generates a you a gpg2 key, After that’s done you can list it with
Copy the key id (from the line labelled
[uid]
) and doAfter that
docker login
worked fine since it defaults to usepass
and only tries to fallback tosecretservice
if it can’t find it.secretservice
seems to have an X11 dependency which isn’t present on a basic server install.Side effect is that you get a somewhat more secure credentials store or on your server instead of a base64 encoded json file.
I disagree, not a better message, when x11 is not installed we should use docker login without any error.
It’s very much an issue. Fresh install of 18.04, installed docker-compose through pip. Exact same issue.
hi, why is the issue closed? the workaround from @kiliankoe works but it is still a problem on a new ubuntu 18.04 installation.
I found that if you remove the golang-docker-credential-helpers package after switching to docker-ce and not the bundled docker package in ubuntu 18.04, this problem is resolved.
golang-docker-credential-helpers
does also get installed alongsidepython-docker
. 😑 I decided to go with this solution.Deleting docker-compose (apt-get autoremove) is the workaround
I’m seeing this issue even when following the official instructions to install docker-compose (https://docs.docker.com/compose/install/#install-compose)
Same problem is I move to:
As a side note, this issue is compounded by the fact the Ubuntu packages and the “official” docker packages are disjointed. You have the docker.io packages on Ubuntu vs. the docker-ce packages from the official download. Seems to make things that more confusing as it’s not obvious which combination of packages one needs, especially when running into issues such as the above.
Follow @shin-'s advice:
don’t do
apt install docker-compose
and if you did, remove it and its dependencies:apt remove docker-compose -y && apt autoremove
. With the official installation the problem’s gone.https://bugs.launchpad.net/ubuntu/+source/docker-compose/+bug/1796119
I added a bug report here, https://bugs.launchpad.net/ubuntu/+source/golang-github-docker-docker-credential-helpers/+bug/1794307
Looks like a bug with the Ubuntu package, which is not owned by us. Additionally, the version the package installs (1.17.1) is no longer supported.
Please follow the official install instructions instead: https://docs.docker.com/compose/install/