-
-
Save eugenestarchenko/faa6eeb12c905270040e1f6f8d2f7d45 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 hidden or 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