Docker登录:手动登录专用注册表时出错 [英] Docker Login: Error when manually logging into private Registry

查看:293
本文介绍了Docker登录:手动登录专用注册表时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法从CLI手动登录我的私有GitLab Docker注册表:

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`

系统信息:


  • Ubuntu 18.04

  • docker-ce 18.03.1〜ce〜3-0〜ubuntu(来自官方仓库,未安装脚本)

任何用户都没有〜/ .docker / config.json ,我正在执行 docker登录作为根。
在Google上,我只是找到有关导出DISPLAY 的建议...码头工人只能在GUI环境中登录到远程注册表吗?
导出DISPLAY = 0:0时产生的结果:

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)`

我错过了一些依赖?否则,Docker可以正常运行,但无法登录。我知道有用于存储凭据的后端,但是我不想存储凭据。我只是想对我的注册表进行身份验证以提取映像,在Docker ootb中不起作用吗?

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?

推荐答案

The docker-compose 程序包不必要地取决于损坏的 golang-github-docker-docker-credential-helpers 软件包。

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.

这会影响Ubuntu 18.04(以及其他非LTS发行版)和某些 Debian 发行版

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

这篇关于Docker登录:手动登录专用注册表时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆