Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker Login: Error when manually logging into private Registry

I can't manually log into my private GitLab Docker Registry from CLI:

# docker login -u "${DOCKER_USER}" -p "${DOCKER_PASS}" "${DOCKER_URL}"
error getting credentials - err: exit status 1, out: `Cannot autolaunch D-Bus without X11 $DISPLAY`

System info:

  • Ubuntu 18.04
  • docker-ce 18.03.1~ce~3-0~ubuntu (from official repo, without install script)

There is no ~/.docker/config.json for any users and I'm executing the docker login as root. On Google, I just find recommendations to export DISPLAY... Can docker only login to remote registries in a GUI environment? Exporting DISPLAY=0:0 yields:

error getting credentials - err: exit status 1, out: `Failed to execute child process “dbus-launch” (No such file or directory)`

Am I missing some dependency? Docker runs fine otherwise, but login doesn't work. I know there are backends to store credentials, but I don't want to store credentials. I'm just trying to authenticate against my registry to pull an image, doesn't that work in Docker ootb?

like image 252
NoMad Avatar asked Jul 03 '18 11:07

NoMad


People also ask

Which options configure the docker daemon to connect to a registry?

In a typical setup where you run your Registry from the official image, you can specify a configuration variable from the environment by passing -e arguments to your docker run stanza or from within a Dockerfile using the ENV instruction. This variable overrides the /var/lib/registry value to the /somewhere directory.

Where are docker registry credentials stored?

You can log into any public or private repository for which you have credentials. When you log in, the command stores credentials in $HOME/. docker/config. json on Linux or %USERPROFILE%/.


1 Answers

The docker-compose package unnecessarily depend on the broken golang-github-docker-docker-credential-helpers package. Removing the executable fixes this.

rm /usr/bin/docker-credential-secretservice

Note: This is a workaround and will need to be repeated each time the package is updated.

This affects the Ubuntu 18.04 (and possibly other non-LTS releases) and some Debian releases.

like image 61
Gert van den Berg Avatar answered Oct 28 '22 20:10

Gert van den Berg