在未安装X11的服务器上docker登录失败 [英] docker login fails on a server with no X11 installed
问题描述
我正在尝试在私有Docker注册表上部署包含映像的docker配置。
现在,每次执行 docker登录注册表.example.com
,我收到以下错误消息:
获取凭据时出错-错误:退出状态1,输出:
没有X11,不能自动启动D-Bus
我发现非MacOS用户的唯一解决方案是运行首先导出$(dbus-launch)
,但这并没有什么改变。
我正在运行Ubuntu Server,并尝试使用Ubuntu Docker包和Docker-CE包。
没有X11会话如何登录?
看起来像是因为它默认使用 secretservice c可执行文件,由于某种原因,该可执行文件似乎具有某种X11依赖性。如果您安装并配置
pass
docker会使用它来解决问题。
来自 https://github.com/docker/compose/issues/6023 )
sudo apt install gnupg2 pass
gpg2 --full-generate-key
这会为您生成一个gpg2密钥。完成后,您可以使用
gpg2 -k
$ p将其列出$ p>
复制密钥ID(从标记为
[uid]
的行中)并执行pass init无论您拥有什么密钥ID
现在
docker登录
应该可以工作。
在启动板上记录了一些与此有关的错误:
https://bugs.launchpad .net / ubuntu / + source / docker-compose / + bug / 1796119
I am trying to deploy a docker configuration with images on a private docker registry.
Now, every time I execute
docker login registry.example.com
, I get the following error message:error getting credentials - err: exit status 1, out:
Cannot autolaunch D-Bus without X11 $DISPLAY
The only solution I found for non-MacOS users was to run
export $(dbus-launch)
first, but that did not change anything.I am running Ubuntu Server and tried with both the Ubuntu Docker package and the Docker-CE package.
How can I log in without an X11 session?
解决方案Looks like this is because it defaults to use the
secretservice
executable which seems to have some sort of X11 dependency for some reason. If you install and configurepass
docker will use that instead which seems to solve the problem.In a nutshell (from https://github.com/docker/compose/issues/6023)
sudo apt install gnupg2 pass gpg2 --full-generate-key
This generates a you a gpg2 key. After that's done you can list it with
gpg2 -k
Copy the key id (from the line labelled
[uid]
) and dopass init "whatever key id you have"
Now
docker login
should work.There are a couple of bugs logged on launchpad regarding this:
https://bugs.launchpad.net/ubuntu/+source/docker-compose/+bug/1796119
这篇关于在未安装X11的服务器上docker登录失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!