Last active
April 7, 2017 11:40
-
-
Save itskingori/43b59e47b6bce65ef5bf4f2fec1e35c4 to your computer and use it in GitHub Desktop.
Authenticate into AWS ECR. Useful in a CI environment (to push images) ... and so on. If you're unhappy evaluating unvalidated commands ... this adds a regex that checks the output from get-login.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See https://forums.aws.amazon.com/thread.jspa?threadID=222215 | |
aws_login=$(aws ecr get-login --region us-east-1); | |
if echo "$aws_login" | grep -q -E '^docker login -u AWS -p \S{1092} -e none https://[0-9]{12}.dkr.ecr.\S+.amazonaws.com$'; then $aws_login; fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment