docker 登录:存储凭据时出错`存根收到错误数据。`

Pan*_*epo 15 powershell amazon-web-services docker aws-cli amazon-ecr

首先,我安装了 AWS-CLI 并且我已经使用“AWS configure”来设置我的密钥,我还使用“Docker login”命令登录并且当我输入 Get-ECRLoginCommand 时我成功了。它有效并为我返回结果。

但是当我尝试使用命令时:

(Get-ECRLoginCommand).Password | docker login --username AWS --password-stdin 837859123533.dkr.ecr.ap-east-1.amazonaws.com/spring-boot
Run Code Online (Sandbox Code Playgroud)

我收到一个错误,如下所示:

保存凭据时出错:存储凭据时出错 - 错误:退出状态 1,输出:error storing credentials - err: exit status 1, out:存根收到错误数据。``

sas*_*alm 24

编辑:另见 Ethan Davis 的解决方案:

我发现删除 C:\Program Files\Docker\Docker\resources\bin\docker-credential-desktop.exe 和 C:\Program Files\Docker\Docker\resources\bin\docker-credential-wincred.exe 对我有用. – 伊桑·戴维斯 20 年 9 月 29 日 18:10


原文:Joelster 评论链接的解决方案对我有用

一种快速解决方法是修改 .docker\config.json 文件。删除以下行,以便 docker 将使用文件系统来存储令牌:

          "credsStore": "wincred"
Run Code Online (Sandbox Code Playgroud)

我打开了文件c:\Users\sashoalm\.docker\config.json,然后删除了“credsStore”键。之后这工作:

type pass.txt | docker login -u AWS --password-stdin https://123123.dkr.ecr.us-west-1.amazonaws.com
Run Code Online (Sandbox Code Playgroud)

输出是这样的:

WARNING! Your password will be stored unencrypted in C:\Users\sashoalm\.docker\config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
Run Code Online (Sandbox Code Playgroud)

  • 我发现删除 `C:\Program Files\Docker\Docker\resources\bin\docker-credential-desktop.exe` 和 `C:\Program Files\Docker\Docker\resources\bin\docker-credential-wincred.exe `为我工作。 (12认同)
  • 上述解决方案也对我有用。非常感谢你,萨绍尔姆。 (3认同)
  • 为我工作(Windows 10 + Docker 桌面):重命名所有 3 个 docker-credential-{desktop|ecr-login|wincred}.exe _and_ 使 config.json 成为完全空的 `{}`。我已经重新启动了 Docker 桌面,并使用我删除的“{"credStore":"desktop","credsStore":"desktop"}` 填充了 config.json。 (2认同)
  • 谢谢。通过从 C:\Users\norman\.docker\config.json 中删除 "credsStore": "wincred" 对我有用! (2认同)

小智 5

到今天为止,这个问题仍然存在。以下是我发现的东西-

1.) 使用 SSO 进行身份验证时会出现此问题。我正在为 AWS 使用 Azure SSO。(https://www.npmjs.com/package/aws-azure-login

2.) 原因是 - 从 SSO 返回的令牌足够长(超过 2550 个字符),而 Windows 凭据管理器不支持这么长的令牌。

3.) 如果您使用 ECR 凭证助手 ( https://github.com/awslabs/amazon-ecr-credential-helper ),遗憾的是它似乎也不适用于 SSO- https://github.com/awslabs/ amazon-ecr-credential-helper/issues/229

但是,我按照这些步骤作为解决方法并且我在 Windows 上-

1.) 删除/重命名"docker-credential-wincred.exe"位于"C:\Program Files\Docker\Docker\resources\bin"目录中的文件。

2.)从 docker config( ) 中删除"credStore"&"credsStore"C:\Users\PROFILE_NAME\.docker\config.json

我得到以下回应-

WARNING! Your password will be stored unencrypted in C:\Users\sandeep.kumar\.docker\config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
Run Code Online (Sandbox Code Playgroud)
  • 开票解决这个问题——

https://github.com/danieljoos/wincred/issues/18

https://github.com/aws/aws-cli/issues/5636


Ren*_* B. 5

正如 @Ethan Davis 提到的,删除以下文件对我有帮助:

  • C:\Program Files\Docker\Docker\resources\bin\docker-credential-desktop.exe
  • C:\Program Files\Docker\Docker\resources\bin\docker-credential-wincred.exe

  • 但现在我面临这个问题: 保存凭据时出错:存储凭据时出错 - 错误:退出状态 1,输出:`获取凭据时出错 - 错误:docker-credential-wincred.exe 解析为当前目录中的可执行文件 (.\docker-credential- wincred.exe),输出:``` (2认同)