aws ecr get-login should use --password-stdin if available
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
Solution: aws ecr get-login should use --password-stdin if available
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
Trust Score
6 verifications
- 1
This is more friendly for Windows (git bash) and related clients.
This is more friendly for Windows (git bash) and related clients.
- 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
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
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep