我刚刚更新了我的docker版本并找到了该命令
aws ecr get-login
不再有效了。得到错误:
未知的速记标志:'e'在-e`中。似乎docker不再支持-e标志了。
有没有办法解决这个问题?
已安装的版本:
aws-cli/1.11.111 Python/2.7.10 Darwin/16.6.0 botocore/1.5.74
Docker version 17.06.0-ce-rc5, build b7e4173
答案 0 :(得分:174)
将此添加到您的通话
--no-include-email
这是新的有效语法:
aws ecr get-login ${normal_params_here} --no-include-email
aws ecr get-login --region us-east-1 --no-include-email # for example
从2017年5月23日发布的版本1.11.91开始,AWS CLI中提供了此新选项...请将此问题升级:
pip install --upgrade awscli
在此处查看详细信息
https://github.com/docker/for-mac/issues/1762
https://github.com/aws/aws-cli/issues/1926
引用:
"您应该在2017年5月23日左右收到an email notification from Amazon关于--no-include-email
上新aws ecr get-login
标志的信息,以便与[Docker] 17.06.0"
答案 1 :(得分:18)
如果由于某种原因你无法升级awscli版本,你可以做一些字符串操作,使它适用于sed。
例如:
$(aws ecr get-login --region eu-central-1 | sed -e 's/-e none//g')
这将删除不支持的-e标志,您应该可以登录。
答案 2 :(得分:6)
我有同样的问题,但斯科特斯坦斯兰德的答案没有解决它。
如果发生在其他人身上,请放弃' -e none'从命令解决了这个问题。
答案 3 :(得分:1)
如果您不想避免使用x
手动刷新身份验证令牌,则可以安装Amazon ECR credential helper。凭证帮助程序将负责自动检索和更新令牌,因此您无需自己刷新它。软件包可用于Debian(Buster或更高版本),Ubuntu(19.10或更高版本),Amazon Linux 2,Mac OS(通过Homebrew)和其他一些操作系统,也可以从the releases page下载二进制发行版。 / p>
答案 4 :(得分:0)
运行登录语句。
aws ecr get-login --region us-west-2
然后,从结果语句中删除标志和值-e none
。
因此,您所运行的将是...
docker login -u AWS -p <long password hash> https://<image ID>.dkr.ecr.us-west-2.amazonaws.com
答案 5 :(得分:0)
C:\WINDOWS\system32>docker rm -f $(docker ps -qa)
unknown shorthand flag: 'q' in -qa)
See 'docker rm --help'.
如果问题是由 Windows 操作系统引起的,请尝试在 PowerShell 中使用 管理员权限
运行该命令它对我有用。