无法登录到 Docker 帐户 [英] Cannot login to Docker account

查看:32
本文介绍了无法登录到 Docker 帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

OS: Ubuntu 18.04 Server
Docker 18.3 CE

我使用 PuTTY SSH 会话从我的 Windows 10 笔记本电脑登录到服务器.

I am logged onto the server, from my Windows 10 laptop, using a PuTTY SSH session.

我的本​​地 Windows 笔记本电脑上没有 Docker,所以所有工作都在远程服务器上完成.

I don't have Docker on my local Windows laptop, so all the work is done on the remote server.

我可以使用终端会话在远程服务器上执行所有 Docker 命令.

I can execute all Docker commands, on the remote server, using the terminal session.

但是,当我尝试将图像保存到 Docker 集线器时,当我尝试登录时,使用:

However, when I try to save my image to the Docker hub, when I try to login, using:

docker login

我收到以下错误消息:

error getting credentials - err: exit status 1, out: `GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.secrets was not provided by any .service files`

我在远程服务器上创建图像时没有收到任何错误消息.

I did not get any error messages, when I created my image on the remote server.

我也没有在远程服务器的相关主目录中看到 .docker 文件夹.有什么想法吗?

I also do not see a .docker folder in the related home directory on the remote server. Any ideas?

推荐答案

Edit 2019-04-07:

Edit 2019-04-07:

由于这是当前选择的答案,我认为人们应该首先尝试下面的@Anish Varghese 解决方案,因为它似乎是最简单的.您只需要安装 gnupg2 并传递软件包:

As this is the currently selected answer, I think people should try @Anish Varghese solution below first as it seems to be the easiest. You only need to install the gnupg2 and pass packages:

sudo apt install gnupg2 pass

sudo apt install gnupg2 pass

如果它不起作用,那么您可以在这里尝试我的原始解决方案:

If it doesn't work, then you can try my original solution here:

我遇到了同样的问题.bak2trak 答案有效,但它以明文形式保存了凭据.如果您想将它们保存在密码存储中,这里是解决方案.

I had the same issue. bak2trak answer worked, but it saved credentials in clear text. Here's the solution if you want to keep them in a password store.

1) 从 https://github.com/docker 下载 docker-credential-pass/docker-credential-helpers/releases

2) tar -xvf docker-credential-pass.tar.gz

3) chmod u+x docker-credential-pass

4) mv docker-credential-pass/usr/bin

5) 您需要设置 docker-credential-pass(以下步骤基于 https://github.com/docker/docker-credential-helpers/issues/102#issuecomment-388634452)

5) You will need to setup docker-credential-pass (following steps are based of https://github.com/docker/docker-credential-helpers/issues/102#issuecomment-388634452)

5.1) 安装 gpg 并通过 (apt-get install gpg pass)

5.1) install gpg and pass (apt-get install gpg pass)

5.2) gpg --generate-key,输入您的信息.您应该会看到如下内容:

5.2) gpg --generate-key, enter your information. You should see something like this:

pub   rsa3072 2018-10-07 [SC] [expires: 2020-10-06]
      1234567890ABCDEF1234567890ABCDEF12345678

复制 123... 行

Copy the 123... line

5.3) pass init 1234567890ABCDEF1234567890ABCDEF12345678(粘贴)

5.4) pass insert docker-credential-helpers/docker-pass-initialized-check 并设置下一个密码pass is initialized"(不带引号).

5.4) pass insert docker-credential-helpers/docker-pass-initialized-check and set the next password "pass is initialized" (without quotes).

5.5) pass show docker-credential-helpers/docker-pass-initialized-check.您应该看到 pass 已初始化.

5.5) pass show docker-credential-helpers/docker-pass-initialized-check. You should see pass is initialized.

5.6) docker-credential-pass 列表

6) 创建一个 ~/.docker/config.json :

6) create a ~/.docker/config.json with:

{
"credsStore": "pass"
}

7) docker login 现在应该可以工作了

7) docker login should now work

注意:如果您在以后的运行中遇到错误pass store is uninitialized",请运行以下命令(它将重新加载内存中的pass store):

Note: If you get the error "pass store is uninitialized" in future run, run the below command (it will reload the pass store in memory):

pass show docker-credential-helpers/docker-pass-initialized-check

它会询问您的密码并初始化通行证存储.

It will ask your password and it will initialize the pass store.

这是基于这个讨论:https://github.com/moby/moby/issues/25169#issuecomment-431129898

这篇关于无法登录到 Docker 帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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