首页 > 解决方案 > docker login:存储凭据时出错“存根收到错误数据。”

问题描述

首先,我安装了 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

我得到一个看起来像这样的错误:

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

标签: amazon-web-servicespowershelldockeraws-cliamazon-ecr

解决方案


编辑:另见 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"

我打开了文件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

输出是这样的:

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

推荐阅读