FG
☁️ Cloud & DevOpsAmazon

aws ecr get-login should use --password-stdin if available

Freshabout 6 years ago
Mar 14, 20260 views
Confidence Score78%
78%

Problem

Currently, on Docker 17.07+, when evaling the output of `aws ecr get-login`, the following error message appears: [code block] It would be nice if `aws ecr get-login` could use `--password-stdin` if it's available. The workaround is to use `get-authorization-token`, but that involves everyone writing code, whereas `--password-stdin` is a good idea for everyone who'd ever use `aws ecr get-login`.

Error Output

error message appears:

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
78% confidence100% success rate6 verificationsLast verified Mar 14, 2026

Solution: aws ecr get-login should use --password-stdin if available

Low Risk

This is more friendly for Windows (git bash) and related clients. export _DOCKER_REPO="$(aws ecr get-authorization-token --output text --query 'authorizationData[].proxyEndpoint')" aws ecr get-login --no-include-email --region us-east-1 | awk '{print $6}' | docker login -u AWS --password-stdin $_DOCKER_REPO Its also similar to @dsdenes but doesn't hardcode the repo

78

Trust Score

6 verifications

100% success
  1. 1

    This is more friendly for Windows (git bash) and related clients.

    This is more friendly for Windows (git bash) and related clients.

  2. 2

    export _DOCKER_REPO="$(aws ecr get-authorization-token --output text --query 'a

    aws ecr get-login --no-include-email --region us-east-1 | awk '{print $6}' | docker login -u AWS --password-stdin $_DOCKER_REPO

  3. 3

    Its also similar to @dsdenes but doesn't hardcode the repo

    Its also similar to @dsdenes but doesn't hardcode the repo

Validation

Resolved in aws/aws-cli GitHub issue #2875. Community reactions: 15 upvotes.

Verification Summary

Worked: 6
Partial: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

awsclicloudv2